Detail: add device information to --detail --export

We may well want more per-device information here, but this
is a start.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-06-19 10:35:23 +10:00
parent 64e103fe19
commit 54def20f8b
1 changed files with 19 additions and 0 deletions

View File

@ -251,6 +251,25 @@ int Detail(char *dev, struct context *c)
putchar('\n');
}
}
if (sra) {
struct mdinfo *mdi;
for (mdi = sra->devs; mdi; mdi = mdi->next) {
char *path =
map_dev(mdi->disk.major,
mdi->disk.minor, 0);
if (mdi->disk.raid_disk >= 0)
printf("MD_DEVICE_%s_ROLE=%d\n",
mdi->sys_name+4,
mdi->disk.raid_disk);
else
printf("MD_DEVICE_%s_ROLE=spare\n",
mdi->sys_name+4);
if (path)
printf("MD_DEVICE_%s_DEV=%s\n",
mdi->sys_name+4, path);
}
}
goto out;
}