diff options
Diffstat (limited to 'lib/report/report.c')
-rw-r--r-- | lib/report/report.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/report/report.c b/lib/report/report.c index 170df6995..18395f478 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -3427,6 +3427,42 @@ static int _pvduplicate_disp(struct dm_report *rh, struct dm_pool *mem, return _binary_disp(rh, mem, field, duplicate, GET_FIRST_RESERVED_NAME(pv_duplicate_y), private); } +static int _pvdeviceid_disp(struct dm_report *rh, struct dm_pool *mem, + struct dm_report_field *field, + const void *data, void *private) +{ + const struct physical_volume *pv = (const struct physical_volume *) data; + char *repstr; + + if (!pv->device_id) + return _field_set_value(field, "", NULL); + + if (!(repstr = pv_deviceid_dup(mem, pv))) { + log_error("Failed to allocate buffer."); + return 0; + } + + return _field_set_value(field, repstr, NULL); +} + +static int _pvdeviceidtype_disp(struct dm_report *rh, struct dm_pool *mem, + struct dm_report_field *field, + const void *data, void *private) +{ + const struct physical_volume *pv = (const struct physical_volume *) data; + char *repstr; + + if (!pv->device_id_type) + return _field_set_value(field, "", NULL); + + if (!(repstr = pv_deviceidtype_dup(mem, pv))) { + log_error("Failed to allocate buffer."); + return 0; + } + + return _field_set_value(field, repstr, NULL); +} + static int _vgpermissions_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, const void *data, void *private) |