diff options
author | Petr Rockai <prockai@redhat.com> | 2013-08-28 14:11:59 +0200 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2013-08-28 14:54:33 +0200 |
commit | 9e518c18d748577bb942b053eebe7a46e063444f (patch) | |
tree | 5819e42ca4455eed565156378dc0f4f8b998a638 | |
parent | 128ae783a22ec3dfb53160f92a377427baaab40f (diff) | |
download | lvm2-9e518c18d748577bb942b053eebe7a46e063444f.tar.gz |
reporter: Adapt pvseg reporting to label-type fields.
-rw-r--r-- | lib/report/report.c | 11 | ||||
-rw-r--r-- | tools/reporter.c | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/report/report.c b/lib/report/report.c index 107442d7a..59436bd5c 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -710,10 +710,15 @@ static int _pvuuid_disp(struct dm_report *rh __attribute__((unused)), struct dm_ const struct label *label = (const struct label *) data; char *repstr = NULL; - if (!(repstr = id_format_and_copy(mem, label->dev->pvid))) - return_0; + if (!label->dev) + dm_report_field_set_value(field, "", NULL); + else { + if (!(repstr = id_format_and_copy(mem, label->dev->pvid))) + return_0; + + dm_report_field_set_value(field, repstr, NULL); + } - dm_report_field_set_value(field, repstr, NULL); return 1; } diff --git a/tools/reporter.c b/tools/reporter.c index ac5ff6948..95845fc44 100644 --- a/tools/reporter.c +++ b/tools/reporter.c @@ -96,7 +96,7 @@ static int _pvsegs_sub_single(struct cmd_context *cmd, dm_list_init(&_free_logical_volume.snapshot_segs); if (!report_object(handle, vg, seg ? seg->lv : &_free_logical_volume, pvseg->pv, - seg ? : &_free_lv_segment, pvseg, NULL)) { + seg ? : &_free_lv_segment, pvseg, pv_label(pvseg->pv))) { ret = ECMD_FAILED; goto_out; } |