]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
Centralise code for copying uuid
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 41360c4813afa403a234f8e89f1879482dd44fe0..b5dce73af2482ebd4123aefa103aef0a1612e00f 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -201,6 +201,7 @@ int main(int argc, char *argv[])
                case 'S':
                case 'o':
                case 'w':
+               case 'W':
                case 'K': if (!mode) newmode = MISC; break;
                }
                if (mode && newmode == mode) {
@@ -515,6 +516,7 @@ int main(int argc, char *argv[])
                        continue;
 
                        /* now for the Assemble options */
+               case O(CREATE,'u'): /* uuid of array */
                case O(ASSEMBLE,'u'): /* uuid of array */
                        if (ident.uuid_set) {
                                fprintf(stderr, Name ": uuid cannot be set twice.  "
@@ -742,6 +744,7 @@ int main(int argc, char *argv[])
                case O(MISC,'X'):
                case O(MISC,'o'):
                case O(MISC,'w'):
+               case O(MISC,'W'):
                        if (devmode && devmode != opt &&
                            (devmode == 'E' || (opt == 'E' && devmode != 'Q'))) {
                                fprintf(stderr, Name ": --examine/-E cannot be given with -%c\n",
@@ -1134,11 +1137,11 @@ int main(int argc, char *argv[])
 
                rv = Create(ss, devlist->devname, mdfd, chunk, level, layout, size<0 ? 0 : size,
                            raiddisks, sparedisks, ident.name, homehost,
+                           ident.uuid_set ? ident.uuid : NULL,
                            devs_found-1, devlist->next, runstop, verbose-quiet, force, assume_clean,
                            bitmap_file, bitmap_chunk, write_behind, delay);
                break;
        case MISC:
-
                if (devmode == 'E') {
                        if (devlist == NULL && !scan) {
                                fprintf(stderr, Name ": No devices to examine\n");
@@ -1219,6 +1222,8 @@ int main(int argc, char *argv[])
                                        rv |= Query(dv->devname); continue;
                                case 'X':
                                        rv |= ExamineBitmap(dv->devname, brief, ss); continue;
+                               case 'W':
+                                       rv |= Wait(dv->devname); continue;
                                }
                                mdfd = open_mddev(dv->devname, 1);
                                if (mdfd>=0) {