From 9d99b50a88ef1bc74dfdbda19d89594c2cac0945 Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Tue, 11 May 2021 12:43:14 -0700 Subject: 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. --- usr/idbm.c | 6 ++++++ 1 file changed, 6 insertions(+) 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"); -- cgit v1.2.1