diff options
author | NeilBrown <neilb@suse.de> | 2009-03-09 14:10:52 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-03-09 14:10:52 +1100 |
commit | bceedeec55eeb5fc37065fed39159a04cffc1307 (patch) | |
tree | 00ace34087ae6bc5f1ec85794d9fecb15a994e8c /super-ddf.c | |
parent | e5a2a3cf8c2342836b994d9cd844ef3c8ad35597 (diff) | |
download | mdadm-bceedeec55eeb5fc37065fed39159a04cffc1307.tar.gz mdadm-bceedeec55eeb5fc37065fed39159a04cffc1307.tar.xz mdadm-bceedeec55eeb5fc37065fed39159a04cffc1307.zip |
Examine: add examine_export for ddf and avoid crashes.
If the personality doesn't provide export_examine_super, don't crash.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/super-ddf.c b/super-ddf.c index 7ca79fb..8725eab 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1189,6 +1189,18 @@ static void brief_examine_super_ddf(struct supertype *st) } } +static void export_examine_super_ddf(struct supertype *st) +{ + struct mdinfo info; + char nbuf[64]; + getinfo_super_ddf(st, &info); + fname_from_uuid(st, &info, nbuf, ':'); + printf("MD_METADATA=ddf\n"); + printf("MD_LEVEL=container\n"); + printf("MD_UUID=%s\n", nbuf+5); +} + + static void detail_super_ddf(struct supertype *st, char *homehost) { /* FIXME later @@ -3563,6 +3575,7 @@ struct superswitch super_ddf = { #ifndef MDASSEMBLE .examine_super = examine_super_ddf, .brief_examine_super = brief_examine_super_ddf, + .export_examine_super = export_examine_super_ddf, .detail_super = detail_super_ddf, .brief_detail_super = brief_detail_super_ddf, .validate_geometry = validate_geometry_ddf, |