Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iscsi offload changes #136

Merged
merged 15 commits into from
Nov 12, 2024
9 changes: 9 additions & 0 deletions package/yast2-iscsi-client.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Oct 31 11:46:26 UTC 2024 - Knut Anderssen <[email protected]>

- Fixes for bsc##1231385
teclator marked this conversation as resolved.
Show resolved Hide resolved
- Do not call iscsi_offload.sh script anymore using the iscsi
ifaces created by autoLogOn directly and exposing them in the
UI instead of the offload card selection.
- 4.6.4

-------------------------------------------------------------------
Fri Sep 27 14:37:24 UTC 2024 - Knut Anderssen <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-iscsi-client.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-iscsi-client
Version: 4.6.3
Version: 4.6.4
Release: 0
Summary: YaST2 - iSCSI Client Configuration
License: GPL-2.0-only
Expand Down
13 changes: 5 additions & 8 deletions src/include/iscsi-client/dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,16 @@ def widgets
"widget" => :custom,
"custom_widget" => HBox(
MinWidth(
16,
72,
HBox(
# name of iscsi client (/etc/iscsi/initiatorname.iscsi)
TextEntry(Id(:initiator_name), _("&Initiator Name")),
MinWidth(
8,
36,
ComboBox(
Id(:offload_card),
Id(:iface),
Opt(:notify),
# prefer to not translate 'Offload' unless there is a well
# known word for this technology (it's special hardware
# shifting load from processor to card)
_("Offload Car&d"),
_("iSCSI I&face"),
[]
)
)
Expand All @@ -113,7 +110,7 @@ def widgets
"symbol (string, map)"
),
"handle" => fun_ref(
method(:handleOffload),
method(:handleIface),
"symbol (string, map)"
),
"help" => Ops.get_string(@HELPS, "initiator_name", "")
Expand Down
50 changes: 17 additions & 33 deletions src/include/iscsi-client/widgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

module Yast
module IscsiClientWidgetsInclude
include Logger

def initialize_iscsi_client_widgets(_include_target)
textdomain "iscsi-client"
Yast.import "IP"
Expand Down Expand Up @@ -227,15 +229,10 @@ def storeISNS(_key, event)
def initInitName(_key)
Builtins.y2milestone("initiatorname %1", IscsiClientLib.initiatorname)
UI.ChangeWidget(:initiator_name, :Value, IscsiClientLib.initiatorname)
UI.ChangeWidget(:offload_card, :Items, IscsiClientLib.GetOffloadItems)
UI.ChangeWidget(:offload_card, :Value, IscsiClientLib.GetOffloadCard)
Builtins.y2milestone("OffloadCard %1", IscsiClientLib.GetOffloadCard)
if Ops.greater_than(
Builtins.size(
Ops.get_string(IscsiClientLib.getiBFT, "iSCSI_INITIATOR_NAME", "")
),
0
)
UI.ChangeWidget(:iface, :Items, IscsiClientLib.iface_items)
UI.ChangeWidget(:iface, :Value, IscsiClientLib.selected_iface)
log.info "Selected Iface: #{IscsiClientLib.selected_iface}"
unless IscsiClientLib.getiBFT["iSCSI_INITIATOR_NAME"].to_s.empty?
UI.ChangeWidget(:initiator_name, :Enabled, false)
# Not sure if there is such a widget called :write
UI.ChangeWidget(:write, :Enabled, false)
Expand Down Expand Up @@ -290,6 +287,10 @@ def validateInitName(_key, event)
end
end

def iface_value
UI.QueryWidget(:iface, :Value).to_s
end

def storeInitName(_key, event)
event = deep_copy(event)
if Convert.to_string(UI.QueryWidget(:initiator_name, :Value)) !=
Expand All @@ -304,34 +305,17 @@ def storeInitName(_key, event)
else
Service.Restart("iscsid")
end
Builtins.y2milestone(
"write initiatorname %1",
IscsiClientLib.initiatorname
)
end
if Convert.to_string(UI.QueryWidget(:offload_card, :Value)) !=
IscsiClientLib.GetOffloadCard
IscsiClientLib.SetOffloadCard(
Convert.to_string(UI.QueryWidget(:offload_card, :Value))
)
Builtins.y2milestone("OffloadCard %1", IscsiClientLib.GetOffloadCard)
log.info "write initiatorname #{IscsientLib.initiatorname}"
end
IscsiClientLib.iface = iface_value if iface_value != IscsiClientLib.selected_iface
nil
end

def handleOffload(_key, event)
event = deep_copy(event)
if event["EventReason"] || "" == "ValueChanged" &&
event["ID"] || :none == :offload_card
if Convert.to_string(UI.QueryWidget(:offload_card, :Value)) !=
IscsiClientLib.GetOffloadCard
IscsiClientLib.SetOffloadCard(
Convert.to_string(UI.QueryWidget(:offload_card, :Value))
)
Builtins.y2milestone(
"handleOffload OffloadCard %1",
IscsiClientLib.GetOffloadCard
)
def handleIface(_key, event)
if event["EventReason"].to_s == "ValueChanged" && event["ID"] == :iface
if iface_value != IscsiClientLib.selected_iface
IscsiClientLib.iface = iface_value
log.info "handleIface iface: #{IscsiClientLib.selected_iface}"
end
end
nil
Expand Down
Loading
Loading