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:
parent
64e103fe19
commit
54def20f8b
19
Detail.c
19
Detail.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue