We are using to 'onboot' parameter to setup iscsi connections
in the initrd. Thus we should be able to use 'onboot' as a valid
parameter for loginall, too.

References: 449108

Signed-off-by: Hannes Reinecke <h...@suse.de>
---
 usr/iscsiadm.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 5972d01..e3a6b81 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -265,15 +265,10 @@ static int print_ifaces(struct iface_rec *iface, int 
info_level)
 static int
 match_startup_mode(node_rec_t *rec, char *mode)
 {
-       /*
-        * we always skip onboot because this should be handled by
-        * something else
-        */
-       if (rec->startup == ISCSI_STARTUP_ONBOOT)
-               return -1;
-
        if ((!strcmp(mode, "automatic") &&
            rec->startup == ISCSI_STARTUP_AUTOMATIC) ||
+           (!strcmp(mode, "onboot") &&
+           rec->startup == ISCSI_STARTUP_ONBOOT) ||
            (!strcmp(mode, "manual") &&
            rec->startup == ISCSI_STARTUP_MANUAL) ||
            !strcmp(mode, "all"))
@@ -282,6 +277,8 @@ match_startup_mode(node_rec_t *rec, char *mode)
        /* support conn or session startup params */
        if ((!strcmp(mode, "automatic") &&
            rec->conn[0].startup == ISCSI_STARTUP_AUTOMATIC) ||
+           (!strcmp(mode, "onboot") &&
+           rec->conn[0].startup == ISCSI_STARTUP_ONBOOT) ||
            (!strcmp(mode, "manual") &&
            rec->conn[0].startup == ISCSI_STARTUP_MANUAL) ||
            !strcmp(mode, "all"))
@@ -385,12 +382,6 @@ static int
 __login_by_startup(void *data, struct list_head *list, struct node_rec *rec)
 {
        char *mode = data;
-       /*
-        * we always skip onboot because this should be handled by
-        * something else
-        */
-       if (rec->startup == ISCSI_STARTUP_ONBOOT)
-               return -1;
 
        if (match_startup_mode(rec, mode))
                return -1;
@@ -405,7 +396,7 @@ login_by_startup(char *mode)
        struct list_head rec_list;
 
        if (!mode || !(!strcmp(mode, "automatic") || !strcmp(mode, "all") ||
-           !strcmp(mode,"manual"))) {
+                      !strcmp(mode,"manual") || !strcmp(mode, "onboot"))) {
                log_error("Invalid loginall option %s.", mode);
                usage(ISCSI_ERR_INVAL);
                return ISCSI_ERR_INVAL;
-- 
1.7.3.4

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to