summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2021-05-11 12:43:14 -0700
committerLee Duncan <lduncan@suse.com>2021-05-11 12:43:14 -0700
commit9d99b50a88ef1bc74dfdbda19d89594c2cac0945 (patch)
tree24f33278ca2e94b95f3b981d89c572926b2c731c
parentbb0d696b8e8563dcfb75e61dda302c721e6ce6d2 (diff)
downloadopen-iscsi-9d99b50a88ef1bc74dfdbda19d89594c2cac0945.tar.gz
Set default 'startup' to 'onboot' for FW nodes
When "iscsiadm -m discovery -t fw" is ran, nodes are created/updated in the node DB for each firmware target found, but the 'startup' mode values are left as 'manual', when in fact firmware nodes are treated as if this value is 'onboot'. So to keep the node DB in sync with behavior, set these to 'onboot' by default. This should *not* effect any other functionality.
-rw-r--r--usr/idbm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr/idbm.c b/usr/idbm.c
index b94b617..e1a9021 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2458,6 +2458,12 @@ int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite)
rc = idbm_delete_node(&rec);
if (rc)
goto unlock;
+
+ if (drec->type == DISCOVERY_TYPE_FW) {
+ log_debug(8, "setting firmware node 'startup' to 'onboot'");
+ newrec->startup = ISCSI_STARTUP_ONBOOT;
+ newrec->conn[0].startup = ISCSI_STARTUP_ONBOOT;
+ }
log_debug(7, "overwriting existing record");
} else
log_debug(7, "adding new DB record");