From 061f2c6abd014c9f30ca2d784cb535e3e3452c65 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 11 May 2009 15:18:20 +1000 Subject: 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 --- super0.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'super0.c') 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"); } -- cgit