summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2011-06-21 11:23:06 +0200
committerMike Christie <michaelc@cs.wisc.edu>2011-06-26 17:44:59 -0500
commit1a8d7036d0f923ae0a6a4947f7db5104db4fcaa0 (patch)
treeb04a07eaaaf3f14e3de0f708383e9836a5c404fe /usr
parent287229740bc4ba97b072a458c3311dea8c49e4d9 (diff)
downloadopen-iscsi-1a8d7036d0f923ae0a6a4947f7db5104db4fcaa0.tar.gz
Allow 'onboot' as loginall parameter
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 <hare@suse.de>
Diffstat (limited to 'usr')
-rw-r--r--usr/iscsiadm.c19
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;