diff --git a/package/yast2-iscsi-client.changes b/package/yast2-iscsi-client.changes index e6edd99..efbf630 100644 --- a/package/yast2-iscsi-client.changes +++ b/package/yast2-iscsi-client.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Oct 31 11:46:26 UTC 2024 - Knut Anderssen + +- Fixes for bsc#1231385 + - 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 diff --git a/package/yast2-iscsi-client.spec b/package/yast2-iscsi-client.spec index df7e450..446db0d 100644 --- a/package/yast2-iscsi-client.spec +++ b/package/yast2-iscsi-client.spec @@ -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 diff --git a/src/clients/inst_iscsi-client.rb b/src/clients/inst_iscsi-client.rb index 7825c52..d5ec036 100644 --- a/src/clients/inst_iscsi-client.rb +++ b/src/clients/inst_iscsi-client.rb @@ -69,12 +69,13 @@ def main ) # check initiator name, create if not exists IscsiClientLib.checkInitiatorName - - IscsiClientLib.getiBFT IscsiClientLib.LoadOffloadModules + IscsiClientLib.getiBFT # try auto login to target auto_login = IscsiClientLib.autoLogOn + # force a read of ifaces + IscsiClientLib.read_ifaces if auto_login # force a read of sessions in case of auto_login (bsc#1228084) IscsiClientLib.readSessions if auto_login diff --git a/src/include/iscsi-client/dialogs.rb b/src/include/iscsi-client/dialogs.rb index 383662b..68c2bf6 100644 --- a/src/include/iscsi-client/dialogs.rb +++ b/src/include/iscsi-client/dialogs.rb @@ -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"), [] ) ) @@ -113,10 +110,10 @@ def widgets "symbol (string, map)" ), "handle" => fun_ref( - method(:handleOffload), + method(:handleIface), "symbol (string, map)" ), - "help" => Ops.get_string(@HELPS, "initiator_name", "") + "help" => @HELPS["initiator_name"].to_s }, # table of connected targets "connected_table" => { diff --git a/src/include/iscsi-client/helps.rb b/src/include/iscsi-client/helps.rb index 632fc65..63af156 100644 --- a/src/include/iscsi-client/helps.rb +++ b/src/include/iscsi-client/helps.rb @@ -120,7 +120,10 @@ def initialize_iscsi_client_helps(_include_target) ), "initiator_name" => _( "

Initiator Name is a value from /etc/iscsi/initiatorname.iscsi. \nIn case you have iBFT, this value will be added from there and you are only able to change it in the BIOS setup.

" - ), + ) + + _( + "

iSCSI Iface allows to select an specific iSCSI iface to be used for discovering targets.

" + ), "isns" => _( "If you want to use iSNS (Internet Storage Name Service) for discovering targets instead of the default SendTargets method,\nfill in the IP address of the iSNS server and port. The default port should be 3205.\n" ), diff --git a/src/include/iscsi-client/widgets.rb b/src/include/iscsi-client/widgets.rb index 5f7d178..9083a8b 100644 --- a/src/include/iscsi-client/widgets.rb +++ b/src/include/iscsi-client/widgets.rb @@ -33,6 +33,8 @@ module Yast module IscsiClientWidgetsInclude + include Logger + def initialize_iscsi_client_widgets(_include_target) textdomain "iscsi-client" Yast.import "IP" @@ -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) @@ -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)) != @@ -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 diff --git a/src/modules/IscsiClientLib.rb b/src/modules/IscsiClientLib.rb index 0504ca9..9ea14a7 100644 --- a/src/modules/IscsiClientLib.rb +++ b/src/modules/IscsiClientLib.rb @@ -43,6 +43,7 @@ class IscsiClientLibClass < Module # if the binary is in /sbin or in /usr/sbin (usr-merge in openSUSE!) # (bsc#1196086, bsc#1196086) OFFLOAD_SCRIPT = "iscsi_offload".freeze + DISCOVERY_CMD = "iscsiadm -m discovery -P 1".freeze # Driver modules that depend on the iscsiuio service/socket # @@ -57,6 +58,14 @@ class IscsiClientLibClass < Module # Documentation for attributes that are initialized at #main + # @!attribute iface_file + # Entries in the iscsi ifaces file which is initialized by #InitIfaceFile . Every network + # interface that supports open-iscsi can have one o more iscsi ifaces associated with it. + # + # Each entry associates the iscsi file name with the iscsi iface name which is usually the same. + # + # @return [Hash{String => String}] ex. { "bnx2i.9c:dc:71:df:cf:29.ipv4.0" => "bnx2i.9c:dc:71:df:cf:29.ipv4.0"} + # # @!attribute sessions # All connected nodes found via #readSessions # @@ -107,7 +116,7 @@ def main @discovered = [] @targets = [] @currentRecord = [] - @iface_file = {} + @iface_file = nil @iface_eth = [] # Content of the main configuration file (/etc/iscsi/iscsid.conf) @@ -120,8 +129,10 @@ def main @initiatorname = "" # map used for autoYaST @ay_settings = nil - # interface type for hardware offloading + # iscsi interface for hardware offloading @offload_card = "default" + # iscsi iface for discovering + @iface = "default" # Types of offload cards # [,