1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

reporter: Adapt pvseg reporting to label-type fields.

This commit is contained in:
Petr Rockai 2013-08-28 14:11:59 +02:00
parent 2294282184
commit 14ffc9d4df
2 changed files with 9 additions and 4 deletions

View File

@ -727,10 +727,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;
}

View File

@ -107,7 +107,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;
}