Skip to contentSkip to conversation

master - report: add new LVSSTATUS and SEGSSTATUS report type

PATCH Peter Rajnoha 1 participant 1 message Nov 11, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7f90ad84c1f9bbc51a833b7ebb6459842405de52
Commit:        7f90ad84c1f9bbc51a833b7ebb6459842405de52
Parent:        d7e5f038887be820874522674a51071705439c8e
Author:        Peter Rajnoha <[email protected]>
AuthorDate:    Tue Oct 21 12:01:57 2014 +0200
Committer:     Peter Rajnoha <[email protected]>
CommitterDate: Tue Nov 11 08:53:28 2014 +0100

report: add new LVSSTATUS and SEGSSTATUS report type

Similar to LVSINFO type which gathers LV + its DM_DEVICE_INFO, the new LVSSTATUS/SEGSSTATUS report type will gather LV/segment + its DM_DEVICE_STATUS.

Since we can report status only for certain segment, in case of LVSSTATUS we need to choose which segment related to the LV should be processed that represents the "LV status". In case of SEGSSTATUS type it's clear - the status is reported for the segment just processed.

---
 lib/report/report.c |    2 +
 lib/report/report.h |   14 +++---
 tools/reporter.c    |  122 ++++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 121 insertions(+), 17 deletions(-)
lib/report/report.c +2 -0
index 511d6cb..74ba4bc 100644
@@ -1749,9 +1749,11 @@ static const struct dm_report_object_type _report_types[] = {
 	{ VGS, "Volume Group", "vg_", _obj_get_vg },
 	{ 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 },
 	{ PVS, "Physical Volume", "pv_", _obj_get_pv },
 	{ LABEL, "Physical Volume Label", "pv_", _obj_get_label },
 	{ SEGS, "Logical Volume Segment", "seg_", _obj_get_seg },
+	{ SEGSSTATUS, "Logical Volume Device Segment Status", "seg_", _obj_get_lv_with_info_and_seg_status },
 	{ PVSEGS, "Physical Volume Segment", "pvseg_", _obj_get_pvseg },
 	{ 0, "", "", NULL },
 };
lib/report/report.h +8 -6
index e4b302e..20fb6bd 100644
@@ -23,12 +23,14 @@
 typedef enum {
 	LVS		= 1,
 	LVSINFO		= 2,
-	PVS		= 4,
-	VGS		= 8,
-	SEGS		= 16,
-	PVSEGS		= 32,
-	LABEL		= 64,
-	DEVTYPES	= 128
+	LVSSTATUS	= 4,
+	PVS		= 8,
+	VGS		= 16,
+	SEGS		= 32,
+	SEGSSTATUS	= 64,
+	PVSEGS		= 128,
+	LABEL		= 256,
+	DEVTYPES	= 512
 } report_type_t;
 
 struct field;
tools/reporter.c +111 -11

192 lines not on this page · raw message