diff options
author | Kay Sievers <kay.sievers@novell.com> | 2007-05-08 09:17:33 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-05-08 09:17:33 +0200 |
commit | 54bad3644f4ea8132a789e827d05d2e712b4f547 (patch) | |
tree | 2cc04f49d0b3ef104ee2741425e095cf5888d89b /super0.c | |
parent | Fix up calculation of bitmap space when creating v1 metadata. (diff) | |
download | mdadm-54bad3644f4ea8132a789e827d05d2e712b4f547.tar.xz mdadm-54bad3644f4ea8132a789e827d05d2e712b4f547.zip |
Add --export option to --detail to use key=value pairs.
udev likes to get information about a device as key=value pairs so it
can create disk/by-id links etc. So add --export flag which causes
the output of --detail to easily parsable.
From: Kay Sievers <kay.sievers@novell.com>
Diffstat (limited to 'super0.c')
-rw-r--r-- | super0.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -280,6 +280,18 @@ static void brief_detail_super0(void *sbv) else printf("%08x", sb->set_uuid0); } + +static void export_super0(void *sbv) +{ + mdp_super_t *sb = sbv; + printf("MD_UUID="); + if (sb->minor_version >= 90) + printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1, + sb->set_uuid2, sb->set_uuid3); + else + printf("%08x", sb->set_uuid0); + printf("\n"); +} #endif static int match_home0(void *sbv, char *homehost) @@ -940,6 +952,7 @@ struct superswitch super0 = { .brief_examine_super = brief_examine_super0, .detail_super = detail_super0, .brief_detail_super = brief_detail_super0, + .export_super = export_super0, #endif .match_home = match_home0, .uuid_from_super = uuid_from_super0, |