master - report: add lv_ancestors and lv_descendants reporting fields
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6e4aee0492a6c3abbe6ecf24037d57bdd43c41fd Commit: 6e4aee0492a6c3abbe6ecf24037d57bdd43c41fd Parent: 82f6dbfaf7b62c044cd765c207bd8eb1db0edc5a Author: Peter Rajnoha <[email protected]> AuthorDate: Fri Apr 24 11:51:52 2015 +0200 Committer: Peter Rajnoha <[email protected]> CommitterDate: Fri Apr 24 11:51:52 2015 +0200
report: add lv_ancestors and lv_descendants reporting fields
Show full chain of ancestors and descendants for snapshots (both thick and thin - in case of thick, the "ancestor" field is actually equal to "origin" field as snapshots can't be chained for thick snapshots).
These fields display current state as it is, they do not display any history! If the snapshot chain is broken in the middle, we don't report the historical origin (this is going to be a part of another patch and a different set of fields or just a switch for existing fields to show ancestors and descendants with history included).
For example:
(origin --> snapshot)
lvol1 --> lvol2 --> lvol3 --> lvol4
\
--> lvol5 --> lvol6 --> lvol7 --> lvol8$ lvs -o name,pool_lv,origin,ancestors,descendants vg LV Pool Origin Ancestors Descendants lvol1 pool lvol2,lvol3,lvol4,lvol5,lvol6,lvol7,lvol8 lvol2 pool lvol1 lvol1 lvol3,lvol4,lvol5,lvol6,lvol7,lvol8 lvol3 pool lvol2 lvol2,lvol1 lvol4 lvol4 pool lvol3 lvol3,lvol2,lvol1 lvol5 pool lvol2 lvol2,lvol1 lvol6,lvol7,lvol8 lvol6 pool lvol5 lvol5,lvol2,lvol1 lvol7,lvol8 lvol7 pool lvol6 lvol6,lvol5,lvol2,lvol1 lvol8 lvol8 pool lvol7 lvol7,lvol6,lvol5,lvol2,lvol1 --- WHATS_NEW | 1 + lib/report/columns.h | 2 + lib/report/properties.c | 4 ++ lib/report/report.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.119 - ================================== + Add lv_ancestors and lv_descendants reporting fields. Add --ignorelocal option to dumpconfig to ignore the local section. Close connection to lvmetad after fork. Make lvchange able to resume background pvmove polling again.
lib/report/columns.h +2 -0
@@ -64,6 +64,8 @@ FIELD(LVS, lv, SIZ, "MSize", lvid, 6, lvmetadatasize, lv_metadata_size, "For thi FIELD(LVS, lv, NUM, "#Seg", lvid, 4, lvsegcount, seg_count, "Number of segments in LV.", 0) FIELD(LVS, lv, STR, "Origin", lvid, 6, origin, origin, "For snapshots, the origin device of this LV.", 0) FIELD(LVS, lv, SIZ, "OSize", lvid, 5, originsize, origin_size, "For snapshots, the size of the origin device of this LV.", 0) +FIELD(LVS, lv, STR_LIST, "Ancestors", lvid, 12, ancestors, ancestors, "Ancestors of this LV.", 0) +FIELD(LVS, lv, STR_LIST, "Descendants", lvid, 12, descendants, descendants, "Descendants of this LV.", 0) FIELD(LVS, lv, PCT, "Data%", lvid, 6, datapercent, data_percent, "For snapshot and thin pools and volumes, the percentage full if LV is active.", 0) FIELD(LVS, lv, PCT, "Snap%", lvid, 6, snpercent, snap_percent, "For snapshots, the percentage full if LV is active.", 0)FIELD (LVS , lv,PCT ,"Meta%" , lvid,6 , metadatapercent, metadata_percent,"For thin pools, the percentage of metadata full if LV is active." ,0 )
lib/report/properties.c +4 -0
@@ -300,6 +300,10 @@ GET_LV_STR_PROPERTY_FN(origin, lv_origin_dup(lv->vg->vgmem, lv))#define _origin_set prop_not_implemented_set GET_LV_NUM_PROPERTY_FN(origin_size, (SECTOR_SIZE * lv_origin_size(lv)))#define _origin_size_set prop_not_implemented_set +#define _ancestors_set prop_not_implemented_set +#define _ancestors_get prop_not_implemented_get +#define _descendants_set prop_not_implemented_set +#define _descendants_get prop_not_implemented_get GET_LV_NUM_PROPERTY_FN(snap_percent, _snap_percent(lv))#define _snap_percent_set prop_not_implemented_setGET_LV_NUM_PROPERTY_FN (copy_percent,_copy_percent (lv))
lib/report/report.c +100 -0
106 lines not on this page · raw message