]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Include homehost information in --detail where appropriate.
[thirdparty/mdadm.git] / super1.c
index a29795a617225a1fd05e8980d0c2b6f2f52b8293..77118d42b1eee581667764324ef86cfd32b539ad 100644 (file)
--- 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]);