]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
DDF: brief_examine_subarrays_ddf: print array name
authormwilck@arcor.de <mwilck@arcor.de>
Wed, 11 Sep 2013 19:55:35 +0000 (21:55 +0200)
committerNeilBrown <neilb@suse.de>
Thu, 12 Sep 2013 05:44:10 +0000 (15:44 +1000)
Print an array name in brief output, like IMSM does.

SUSE's YaST2 (libstorage) needs this in order to detect MD arrays
during installation.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c

index e886445109fee435188f7b4fa1d27446c4cc05e2..3673cb33cfeebd17c7fa1a86089a2bbc36d85a3a 100644 (file)
@@ -1519,6 +1519,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *m
 
 static void uuid_from_ddf_guid(const char *guid, int uuid[4]);
 static void uuid_from_super_ddf(struct supertype *st, int uuid[4]);
+static void _ddf_array_name(char *name, const struct ddf_super *ddf, int i);
 
 static unsigned int get_vd_num_of_subarray(struct supertype *st)
 {
@@ -1578,6 +1579,7 @@ static void brief_examine_subarrays_ddf(struct supertype *st, int verbose)
                struct virtual_entry *ve = &ddf->virt->entries[i];
                struct vcl vcl;
                char nbuf1[64];
+               char namebuf[17];
                if (all_ff(ve->guid))
                        continue;
                memcpy(vcl.conf.guid, ve->guid, DDF_GUID_LEN);
@@ -1585,7 +1587,9 @@ static void brief_examine_subarrays_ddf(struct supertype *st, int verbose)
                vcl.vcnum = i;
                uuid_from_super_ddf(st, info.uuid);
                fname_from_uuid(st, &info, nbuf1, ':');
-               printf("ARRAY container=%s member=%d UUID=%s\n",
+               _ddf_array_name(namebuf, ddf, i);
+               printf("ARRAY%s%s container=%s member=%d UUID=%s\n",
+                      namebuf[0] == '\0' ? "" : " /dev/md/", namebuf,
                       nbuf+5, i, nbuf1+5);
        }
 }