diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2013-09-11 23:59:31 -0700 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2013-09-11 23:59:31 -0700 |
commit | 5992173f13550d75659fec1d7e1f6e87895d560a (patch) | |
tree | 4f44e7085f289030d7acfd36e1989fb78ff08472 /utils | |
parent | 82c853344888c2d541d6445a08ab31cbcf1c140f (diff) | |
download | open-iscsi-5992173f13550d75659fec1d7e1f6e87895d560a.tar.gz |
[PATCH v5 1/3] ISCSISTART: Saved ibft boot info to the session
Patch and description from Eddie Wai:
Three new session sysfs parameters are introduced:
boot_root - holds the ibft boot root folder name
boot_nic - holds the ibft boot ethernetN name
boot_target - holds the ibft boot targetN name
This patch copies over the /sys/firmware/<boot_root>/ethernetN/targetN
info
from the boot context to the node_rec.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/fwparam_ibft/fwparam_sysfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c index 3997363..2f37b59 100644 --- a/utils/fwparam_ibft/fwparam_sysfs.c +++ b/utils/fwparam_ibft/fwparam_sysfs.c @@ -200,6 +200,9 @@ static int fill_nic_context(char *subsys, char *id, strlcpy(context->scsi_host_name, subsys, sizeof(context->scsi_host_name)); + memset(&context->boot_nic, 0, sizeof(context->boot_nic)); + snprintf(context->boot_nic, sizeof(context->boot_nic), "%s", id); + sysfs_get_str(id, subsys, "ip-addr", context->ipaddr, sizeof(context->ipaddr)); sysfs_get_str(id, subsys, "vlan", context->vlan, @@ -224,6 +227,8 @@ static void fill_initiator_context(char *subsys, struct boot_context *context) sizeof(context->initiatorname)); sysfs_get_str("initiator", subsys, "isid", context->isid, sizeof(context->isid)); + + strlcpy(context->boot_root, subsys, sizeof(context->boot_root)); } static int fill_tgt_context(char *subsys, char *id, struct boot_context *context) @@ -240,6 +245,9 @@ static int fill_tgt_context(char *subsys, char *id, if (rc) return rc; + memset(&context->boot_target, 0, sizeof(context->boot_target)); + snprintf(context->boot_target, sizeof(context->boot_target), "%s", id); + /* * We can live without the rest of they do not exist. If we * failed to get them we will figure it out when we login. |