summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2011-06-21 11:23:04 +0200
committerMike Christie <michaelc@cs.wisc.edu>2011-06-26 17:42:24 -0500
commitc440cbe7ba2464f8baadedb55b00754c36773c2c (patch)
tree60c52c9c150840aecb71845ba23e0d7393f21a9c
parentfcf4e53f577a47b4666052ad024f83eb984a658a (diff)
downloadopen-iscsi-c440cbe7ba2464f8baadedb55b00754c36773c2c.tar.gz
Keep startup mode in sync when specified in config file
When the startup mode has been specified in iscsid.conf it needs to be kept in sync for both settings, 'node.startup' and 'node.conn[0].startup'. References: bnc#458142 Signed-off-by: Hannes Reinecke <hare@suse.de>
-rw-r--r--usr/idbm.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/usr/idbm.c b/usr/idbm.c
index a73b410..2cb346d 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -598,6 +598,8 @@ void idbm_recinfo_config(recinfo_t *info, FILE *f)
char name[NAME_MAXVAL];
char value[VALUE_MAXVAL];
char *line, *nl, buffer[2048];
+ char *node_startup_value = NULL;
+ char *conn_startup_value = NULL;
int line_number = 0;
int c = 0, i;
@@ -656,8 +658,29 @@ void idbm_recinfo_config(recinfo_t *info, FILE *f)
}
*(value+i) = 0;
- idbm_rec_update_param(info, name, value, line_number);
+ if (!strcmp(name, "node.startup")) {
+ node_startup_value = strdup(value);
+ }
+ if (!strcmp(name, "node.conn[0].startup")) {
+ conn_startup_value = strdup(value);
+ }
+ (void)idbm_rec_update_param(info, name, value, line_number);
} while (line);
+ /*
+ * Compat hack:
+ * Keep node.startup and node.conn[0].startup in sync even
+ * if only one of those has been specified in the config file.
+ */
+ if (node_startup_value && !conn_startup_value) {
+ (void)idbm_rec_update_param(info, "node.conn[0].startup",
+ node_startup_value, 0);
+ free(node_startup_value);
+ }
+ if (conn_startup_value && !node_startup_value) {
+ (void)idbm_rec_update_param(info, "node.startup",
+ conn_startup_value, 0);
+ free(conn_startup_value);
+ }
}
/*