summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-19 07:13:03 +0000
committerNeil Brown <neilb@suse.de>2006-05-19 07:13:03 +0000
commitb6750aa8da57bfc0eb3a3bdc47c289638b1022c8 (patch)
treefadb26de92f6cd4c8ca07064133250b9fb47a32d /super1.c
parent05697ec1e26eadc2f814d9f84f8c783fff5b98b5 (diff)
downloadmdadm-b6750aa8da57bfc0eb3a3bdc47c289638b1022c8.tar.gz
mdadm-b6750aa8da57bfc0eb3a3bdc47c289638b1022c8.tar.xz
mdadm-b6750aa8da57bfc0eb3a3bdc47c289638b1022c8.zip
Include homehost information in --detail where appropriate.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/super1.c b/super1.c
index a29795a..77118d4 100644
--- a/super1.c
+++ b/super1.c
@@ -317,13 +317,18 @@ static void brief_examine_super1(void *sbv)
printf("\n");
}
-static void detail_super1(void *sbv)
+static void detail_super1(void *sbv, char *homehost)
{
struct mdp_superblock_1 *sb = sbv;
int i;
-
- printf(" Name : %.32s\n", sb->set_name);
- printf(" UUID : ");
+ int l = homehost ? strlen(homehost) : 0;
+
+ printf(" Name : %.32s", sb->set_name);
+ if (l > 0 && l < 32 &&
+ sb->set_name[l] == ':' &&
+ strncmp(sb->set_name, homehost, l) == 0)
+ printf(" (local to host %s)", homehost);
+ printf("\n UUID : ");
for (i=0; i<16; i++) {
if ((i&3)==0 && i != 0) printf(":");
printf("%02x", sb->set_uuid[i]);