From 0237e0cafd5ff70304f0b09ed452adbe0e0e6384 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 23 May 2006 05:16:32 +0000 Subject: Support --update=homehost to allow updating of homehost information. Signed-off-by: Neil Brown --- super1.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'super1.c') diff --git a/super1.c b/super1.c index 2ccda5d..b24bcea 100644 --- a/super1.c +++ b/super1.c @@ -496,6 +496,17 @@ static int update_super1(struct mdinfo *info, void *sbv, char *update, memcpy(bm->uuid, info->uuid, 16); } } + if (strcmp(update, "homehost") == 0 && + homehost) { + char *c; + update = "name"; + c = strchr(sb->set_name, ':'); + if (c) + strncpy(info->name, c+1, 31 - (c-sb->set_name)); + else + strncpy(info->name, sb->set_name, 32); + info->name[33] = 0; + } if (strcmp(update, "name") == 0) { if (info->name[0] == 0) sprintf(info->name, "%d", info->array.md_minor); -- cgit