]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Support --update=homehost to allow updating of homehost information.
[thirdparty/mdadm.git] / super1.c
index 2ccda5dab2eaafaf11d2dd29c0021e1d8bae231e..b24bceae2ea291f6461638c7fe4487d5f349dac2 100644 (file)
--- 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);