diff --git a/lib/report/columns.h b/lib/report/columns.h index 2b788c126..25eca8012 100644 --- a/lib/report/columns.h +++ b/lib/report/columns.h @@ -38,7 +38,7 @@ FIELD(LVS, lv, STR, "LV", lvid, 4, lvfullname, lv_full_name, "Full name of LV in FIELD(LVS, lv, STR, "Path", lvid, 4, lvpath, lv_path, "Full pathname for LV. Blank for internal LVs.", 0) FIELD(LVS, lv, STR, "DMPath", lvid, 6, lvdmpath, lv_dm_path, "Internal device-mapper pathname for LV (in /dev/mapper directory).", 0) FIELD(LVS, lv, STR, "Parent", lvid, 6, lvparent, lv_parent, "For LVs that are components of another LV, the parent LV.", 0) -FIELD(LVSINFO, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0) +FIELD(LVSINFOSTATUS, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0) FIELD(LVS, lv, STR_LIST, "Layout", lvid, 10, lvlayout, lv_layout, "LV layout.", 0) FIELD(LVS, lv, STR_LIST, "Role", lvid, 10, lvrole, lv_role, "LV role.", 0) FIELD(LVS, lv, BIN, "InitImgSync", lvid, 10, lvinitialimagesync, lv_initial_image_sync, "Set if mirror/RAID images underwent initial resynchronization.", 0) diff --git a/lib/report/report.c b/lib/report/report.c index 01e8f067c..b3365b08c 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -1904,6 +1904,7 @@ static const struct dm_report_object_type _report_types[] = { { LVS, "Logical Volume", "lv_", _obj_get_lv }, { LVSINFO, "Logical Volume Device Info", "lv_", _obj_get_lv_with_info_and_seg_status }, { LVSSTATUS, "Logical Volume Device Status", "lv_", _obj_get_lv_with_info_and_seg_status }, + { LVSINFOSTATUS, "Logical Volume Device Info and Status Combined", "lv_", _obj_get_lv_with_info_and_seg_status }, { PVS, "Physical Volume", "pv_", _obj_get_pv }, { LABEL, "Physical Volume Label", "pv_", _obj_get_label }, { SEGS, "Logical Volume Segment", "seg_", _obj_get_seg }, diff --git a/lib/report/report.h b/lib/report/report.h index 8ff34543c..563f684e18 100644 --- a/lib/report/report.h +++ b/lib/report/report.h @@ -24,13 +24,14 @@ typedef enum { LVS = 1, LVSINFO = 2, LVSSTATUS = 4, - PVS = 8, - VGS = 16, - SEGS = 32, - SEGSSTATUS = 64, - PVSEGS = 128, - LABEL = 256, - DEVTYPES = 512 + LVSINFOSTATUS = 8, + PVS = 16, + VGS = 32, + SEGS = 64, + SEGSSTATUS = 128, + PVSEGS = 256, + LABEL = 512, + DEVTYPES = 1024 } report_type_t; struct field; diff --git a/tools/reporter.c b/tools/reporter.c index b5edfa695..29d326c81 100644 --- a/tools/reporter.c +++ b/tools/reporter.c @@ -523,17 +523,17 @@ static int _report(struct cmd_context *cmd, int argc, char **argv, return_ECMD_FAILED; /* Do we need to acquire LV device info in addition? */ - lv_info_needed = (report_type & LVSINFO) ? 1 : 0; + lv_info_needed = (report_type & (LVSINFO | LVSINFOSTATUS)) ? 1 : 0; /* Do we need to acquire LV device status in addition? */ - lv_segment_status_needed = (report_type & (SEGSSTATUS | LVSSTATUS)) ? 1 : 0; + lv_segment_status_needed = (report_type & (SEGSSTATUS | LVSSTATUS | LVSINFOSTATUS)) ? 1 : 0; /* Ensure options selected are compatible */ if (report_type & (SEGS | SEGSSTATUS)) report_type |= LVS; if (report_type & PVSEGS) report_type |= PVS; - if ((report_type & (LVS | LVSINFO | LVSSTATUS)) && (report_type & (PVS | LABEL)) && !args_are_pvs) { + if ((report_type & (LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS)) && (report_type & (PVS | LABEL)) && !args_are_pvs) { log_error("Can't report LV and PV fields at the same time"); dm_report_free(report_handle); return ECMD_FAILED; @@ -541,7 +541,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv, /* Change report type if fields specified makes this necessary */ if ((report_type & PVSEGS) || - ((report_type & (PVS | LABEL)) && (report_type & (LVS | LVSINFO | LVSSTATUS)))) + ((report_type & (PVS | LABEL)) && (report_type & (LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS)))) report_type = PVSEGS; else if ((report_type & LABEL) && (report_type & VGS)) report_type = PVS; @@ -549,7 +549,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv, report_type = PVS; else if (report_type & (SEGS | SEGSSTATUS)) report_type = SEGS; - else if (report_type & (LVS | LVSINFO | LVSSTATUS)) + else if (report_type & (LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS)) report_type = LVS; /* @@ -574,6 +574,8 @@ static int _report(struct cmd_context *cmd, int argc, char **argv, /* fall through */ case LVSSTATUS: /* fall through */ + case LVSINFOSTATUS: + /* fall through */ case LVS: r = process_each_lv(cmd, argc, argv, 0, report_handle, lv_info_needed && !lv_segment_status_needed ? &_lvs_with_info_single :