summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-05-11 15:18:20 +1000
committerNeilBrown <neilb@suse.de>2009-05-11 15:18:20 +1000
commit061f2c6abd014c9f30ca2d784cb535e3e3452c65 (patch)
tree63c5696cf22393743a3506aee8adfaf2222f4961 /super0.c
parent9652457eea62c06f48df1035218cdcb6f756b74d (diff)
downloadmdadm-061f2c6abd014c9f30ca2d784cb535e3e3452c65.tar.gz
mdadm-061f2c6abd014c9f30ca2d784cb535e3e3452c65.tar.xz
mdadm-061f2c6abd014c9f30ca2d784cb535e3e3452c65.zip
Make --brief even briefer.
Because ---examine --brief, or --detail --brief are often used to create mdadm.conf, and because people don't want to have to update their mdadm.conf unnecessarily, we don't want to include information that might change. And now that level changing is supported, that is almost everything but UUID. So move some more fields into the "Only print with --verbose" class. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/super0.c b/super0.c
index 18e1d45..3f02ed4 100644
--- a/super0.c
+++ b/super0.c
@@ -232,7 +232,7 @@ static void examine_super0(struct supertype *st, char *homehost)
}
}
-static void brief_examine_super0(struct supertype *st)
+static void brief_examine_super0(struct supertype *st, int verbose)
{
mdp_super_t *sb = st->sb;
char *c=map_num(pers, sb->level);
@@ -240,14 +240,18 @@ static void brief_examine_super0(struct supertype *st)
sprintf(devname, "/dev/md%d", sb->md_minor);
- printf("ARRAY %s level=%s num-devices=%d UUID=",
- devname,
- c?c:"-unknown-", sb->raid_disks);
+ if (verbose) {
+ printf("ARRAY %s level=%s num-devices=%d",
+ devname,
+ c?c:"-unknown-", sb->raid_disks);
+ } else
+ printf("ARRAY %s", devname);
+
if (sb->minor_version >= 90)
- printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1,
+ printf(" UUID=%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1,
sb->set_uuid2, sb->set_uuid3);
else
- printf("%08x", sb->set_uuid0);
+ printf(" UUID=%08x", sb->set_uuid0);
printf("\n");
}