summaryrefslogtreecommitdiff
path: root/lib/report
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2015-09-21 13:16:48 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2015-09-21 14:21:39 +0200
commitffa7b37b281faaafaa5053d292502dafcdbf27f9 (patch)
treeb82f4c13b621c7650c5a33cd524ebecccee05061 /lib/report
parentf61a394be4304fbdbfb94376b4e818b5d64d3cfd (diff)
downloadlvm2-ffa7b37b281faaafaa5053d292502dafcdbf27f9.tar.gz
report: add lv_mirror_log_uuid field
Diffstat (limited to 'lib/report')
-rw-r--r--lib/report/columns.h1
-rw-r--r--lib/report/properties.c2
-rw-r--r--lib/report/report.c32
3 files changed, 29 insertions, 6 deletions
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 4793eb69c..27c100588 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -80,6 +80,7 @@ FIELD(LVS, lv, NUM, "MaxSync", lvid, 7, raidmaxrecoveryrate, raid_max_recovery_r
FIELD(LVS, lv, STR, "Move", lvid, 4, movepv, move_pv, "For pvmove, Source PV of temporary LV created by pvmove.", 0)
FIELD(LVS, lv, STR, "Convert", lvid, 7, convertlv, convert_lv, "For lvconvert, Name of temporary LV created by lvconvert.", 0)
FIELD(LVS, lv, STR, "Log", lvid, 3, loglv, mirror_log, "For mirrors, the LV holding the synchronisation log.", 0)
+FIELD(LVS, lv, STR, "Log UUID", lvid, 38, loglvuuid, mirror_log_uuid, "For mirrors, the UUID of the LV holding the synchronisation log.", 0)
FIELD(LVS, lv, STR, "Data", lvid, 4, datalv, data_lv, "For thin and cache pools, the LV holding the associated data.", 0)
FIELD(LVS, lv, STR, "Data UUID", lvid, 38, datalvuuid, data_lv_uuid, "For thin and cache pools, the UUID of the LV holding the associated data.", 0)
FIELD(LVS, lv, STR, "Meta", lvid, 4, metadatalv, metadata_lv, "For thin and cache pools, the LV holding the associated metadata.", 0)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index d2760f284..b151190e4 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -330,6 +330,8 @@ GET_LV_STR_PROPERTY_FN(lv_tags, lv_tags_dup(lv))
#define _lv_tags_set prop_not_implemented_set
GET_LV_STR_PROPERTY_FN(mirror_log, lv_mirror_log_dup(lv->vg->vgmem, lv))
#define _mirror_log_set prop_not_implemented_set
+GET_LV_STR_PROPERTY_FN(mirror_log_uuid, lv_mirror_log_uuid_dup(lv->vg->vgmem, lv))
+#define _mirror_log_uuid_set prop_not_implemented_set
GET_LV_STR_PROPERTY_FN(lv_modules, lv_modules_dup(lv->vg->vgmem, lv))
#define _lv_modules_set prop_not_implemented_set
GET_LV_STR_PROPERTY_FN(data_lv, lv_data_lv_dup(lv->vg->vgmem, lv))
diff --git a/lib/report/report.c b/lib/report/report.c
index 2e1a5ca1d..4cbf82488 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1555,19 +1555,39 @@ static int _segtype_disp(struct dm_report *rh __attribute__((unused)),
return _field_set_value(field, name, NULL);
}
-static int _loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
- struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)))
+static int _do_loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
+ struct dm_report_field *field,
+ const void *data, void *private __attribute__((unused)),
+ int uuid)
{
const struct logical_volume *lv = (const struct logical_volume *) data;
- const char *name;
+ const char *repstr = NULL;
- if ((name = lv_mirror_log_dup(mem, lv)))
- return dm_report_field_string(rh, field, &name);
+ if (uuid)
+ repstr = lv_mirror_log_uuid_dup(mem, lv);
+ else
+ repstr = lv_mirror_log_dup(mem, lv);
+
+ if (repstr)
+ return dm_report_field_string(rh, field, &repstr);
return _field_set_value(field, "", NULL);
}
+static int _loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
+ struct dm_report_field *field,
+ const void *data, void *private __attribute__((unused)))
+{
+ return _do_loglv_disp(rh, mem, field, data, private, 0);
+}
+
+static int _loglvuuid_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)),
+ struct dm_report_field *field,
+ const void *data, void *private __attribute__((unused)))
+{
+ return _do_loglv_disp(rh, mem, field, data, private, 1);
+}
+
static int _lvname_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private __attribute__((unused)))