summaryrefslogtreecommitdiff
path: root/super0.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@novell.com>2007-05-08 17:17:33 +1000
committerNeil Brown <neilb@suse.de>2007-05-08 17:17:33 +1000
commit54bad3644f4ea8132a789e827d05d2e712b4f547 (patch)
tree2cc04f49d0b3ef104ee2741425e095cf5888d89b /super0.c
parent2fb749d1b7588985b1834e43de4ec5685d0b8d26 (diff)
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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/super0.c b/super0.c
index aeee0b7b..5828e15b 100644
--- a/super0.c
+++ b/super0.c
@@ -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,