1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

report: add lv_historical field to identify historical LVs

The lv_historical reporting field is a simple binary field that reports
whether an LV is historical one ("historical" value or value of "1" displayed)
or not (blank string "" or value of "0" displayed).
This commit is contained in:
Peter Rajnoha 2016-03-01 15:23:43 +01:00
parent e112f5ce05
commit 2af5971523
3 changed files with 11 additions and 0 deletions

View File

@ -96,6 +96,7 @@ FIELD(LVS, lv, TIM, "CTime", lvid, 26, lvtime, lv_time, "Creation time of the LV
FIELD(LVS, lv, TIM, "RTime", lvid, 26, lvtimeremoved, lv_time_removed, "Removal time of the LV, if known", 0) FIELD(LVS, lv, TIM, "RTime", lvid, 26, lvtimeremoved, lv_time_removed, "Removal time of the LV, if known", 0)
FIELD(LVS, lv, STR, "Host", lvid, 10, lvhost, lv_host, "Creation host of the LV, if known.", 0) FIELD(LVS, lv, STR, "Host", lvid, 10, lvhost, lv_host, "Creation host of the LV, if known.", 0)
FIELD(LVS, lv, STR_LIST, "Modules", lvid, 7, modules, lv_modules, "Kernel device-mapper modules required for this LV.", 0) FIELD(LVS, lv, STR_LIST, "Modules", lvid, 7, modules, lv_modules, "Kernel device-mapper modules required for this LV.", 0)
FIELD(LVS, lv, BIN, "Historical", lvid, 8, lvhistorical, lv_historical, "Set if the LV is historical.", 0)
FIELD(LVSINFO, lv, SNUM, "KMaj", lvid, 4, lvkmaj, lv_kernel_major, "Currently assigned major number or -1 if LV is not active.", 0) FIELD(LVSINFO, lv, SNUM, "KMaj", lvid, 4, lvkmaj, lv_kernel_major, "Currently assigned major number or -1 if LV is not active.", 0)
FIELD(LVSINFO, lv, SNUM, "KMin", lvid, 4, lvkmin, lv_kernel_minor, "Currently assigned minor number or -1 if LV is not active.", 0) FIELD(LVSINFO, lv, SNUM, "KMin", lvid, 4, lvkmin, lv_kernel_minor, "Currently assigned minor number or -1 if LV is not active.", 0)

View File

@ -253,6 +253,8 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
#define _lv_skip_activation_get prop_not_implemented_get #define _lv_skip_activation_get prop_not_implemented_get
#define _lv_check_needed_set prop_not_implemented_set #define _lv_check_needed_set prop_not_implemented_set
#define _lv_check_needed_get prop_not_implemented_get #define _lv_check_needed_get prop_not_implemented_get
#define _lv_historical_set prop_not_implemented_set
#define _lv_historical_get prop_not_implemented_get
#define _cache_total_blocks_set prop_not_implemented_set #define _cache_total_blocks_set prop_not_implemented_set
#define _cache_total_blocks_get prop_not_implemented_get #define _cache_total_blocks_get prop_not_implemented_get

View File

@ -3385,6 +3385,14 @@ static int _lvskipactivation_disp(struct dm_report *rh, struct dm_pool *mem,
return _binary_disp(rh, mem, field, skip_activation, "skip activation", private); return _binary_disp(rh, mem, field, skip_activation, "skip activation", private);
} }
static int _lvhistorical_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
{
const struct logical_volume *lv = (const struct logical_volume *) data;
return _binary_disp(rh, mem, field, lv_is_historical(lv), "historical", private);
}
/* /*
* Macro to generate '_cache_<cache_status_field_name>_disp' reporting function. * Macro to generate '_cache_<cache_status_field_name>_disp' reporting function.
* The 'cache_status_field_name' is field name from struct dm_cache_status. * The 'cache_status_field_name' is field name from struct dm_cache_status.