summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-08-09 05:23:20 +0000
committerNeil Brown <neilb@suse.de>2005-08-09 05:23:20 +0000
commit947fd4ddb554fd2c3d81c190dfe63407f8771eb8 (patch)
tree10b16db86578ca184faabae4232a886d2cff1ddc /config.c
parentdfd4d8ee426fb71a369f494f95fe95b114a33c7c (diff)
downloadmdadm-947fd4ddb554fd2c3d81c190dfe63407f8771eb8.tar.gz
mdadm-947fd4ddb554fd2c3d81c190dfe63407f8771eb8.tar.xz
mdadm-947fd4ddb554fd2c3d81c190dfe63407f8771eb8.zip
Support nameing of version-1 arrays.
--name is recognised in --create and --assemble name= is recognised in config file. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'config.c')
-rw-r--r--config.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/config.c b/config.c
index 40f33ac..a5d5edd 100644
--- a/config.c
+++ b/config.c
@@ -277,6 +277,7 @@ void arrayline(char *line)
mis.next = NULL;
mis.st = NULL;
mis.bitmap_fd = -1;
+ mis.name[0] = 0;
for (w=dl_next(line); w!=line; w=dl_next(w)) {
if (w[0] == '/') {
@@ -307,6 +308,15 @@ void arrayline(char *line)
mis.super_minor = UnSet;
}
}
+ } else if (strncasecmp(w, "name=", 5)==0) {
+ if (mis.name[0])
+ fprintf(stderr, Name ": only specify name once, %s ignored.\n",
+ w);
+ else if (strlen(w+5) > 32)
+ fprintf(stderr, Name ": name too long, ignoring %s\n", w);
+ else
+ strcpy(mis.name, w+5);
+
} else if (strncasecmp(w, "devices=", 8 ) == 0 ) {
if (mis.devices)
fprintf(stderr, Name ": only specify devices once (use a comma separated list). %s ignored\n",
@@ -375,7 +385,7 @@ void arrayline(char *line)
}
if (mis.devname == NULL)
fprintf(stderr, Name ": ARRAY line with no device\n");
- else if (mis.uuid_set == 0 && mis.devices == NULL && mis.super_minor == UnSet)
+ else if (mis.uuid_set == 0 && mis.devices == NULL && mis.super_minor == UnSet && mis.name[0] == 0)
fprintf(stderr, Name ": ARRAY line %s has no identity information.\n", mis.devname);
else {
mi = malloc(sizeof(*mi));