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

Use iscsi ifaces instead of offload card (bsc#1231385) - SLE-15-SP7 #137

Merged
merged 17 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 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
- 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.7.2

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

Expand All @@ -9,6 +18,7 @@ Fri Sep 27 14:37:24 UTC 2024 - Knut Anderssen <[email protected]>
the deprecated ifconfig command
- 4.7.1

-------------------------------------------------------------------
Fri Sep 06 07:14:32 UTC 2024 - Ladislav Slezák <[email protected]>

- Branch package for SP7 (bsc#1230201)
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.7.1
Version: 4.7.2
Release: 0
Summary: YaST2 - iSCSI Client Configuration
License: GPL-2.0-only
Expand Down
5 changes: 3 additions & 2 deletions src/clients/inst_iscsi-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 6 additions & 9 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,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" => {
Expand Down
5 changes: 4 additions & 1 deletion src/include/iscsi-client/helps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def initialize_iscsi_client_helps(_include_target)
),
"initiator_name" => _(
"<p><b>Initiator Name</b> is a value from <tt>/etc/iscsi/initiatorname.iscsi</tt>. \nIn case you have iBFT, this value will be added from there and you are only able to change it in the BIOS setup.</p>"
),
) +
_(
"<p><b>iSCSI Iface</b> allows to select an specific iSCSI iface to be used for discovering targets.</p>"
),
"isns" => _(
"If you want to use <b>iSNS</b> (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"
),
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