mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
report: add pv_ext_vsn field to display PV header extension version used
For example: $ pvs -o pv_name,vg_name,pv_ext_vsn,pv_in_use PV VG ExtVsn InUse /dev/sda 2 /dev/sdb vg 2 used /dev/vda2 fedora 1 used
This commit is contained in:
parent
e0b1415105
commit
f75e42c06c
@ -122,6 +122,7 @@ FIELD(LABEL, label, SIZ, "DevSize", dev, 7, devsize, dev_size, "Size of underlyi
|
||||
FIELD(LABEL, label, STR, "PV", dev, 10, dev_name, pv_name, "Name.", 0)
|
||||
FIELD(LABEL, label, SIZ, "PMdaFree", type, 9, pvmdafree, pv_mda_free, "Free metadata area space on this device in current units.", 0)
|
||||
FIELD(LABEL, label, SIZ, "PMdaSize", type, 9, pvmdasize, pv_mda_size, "Size of smallest metadata area on this device in current units.", 0)
|
||||
FIELD(LABEL, label, NUM, "PExtVsn", type, 7, pvextvsn, pv_ext_vsn, "PV header extension version.", 0)
|
||||
|
||||
FIELD(PVS, pv, NUM, "1st PE", pe_start, 7, size64, pe_start, "Offset to the start of data on the underlying device.", 0)
|
||||
FIELD(PVS, pv, SIZ, "PSize", id, 5, pvsize, pv_size, "Size of PV in current units.", 0)
|
||||
|
@ -190,6 +190,8 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
|
||||
#define _pv_exported_get prop_not_implemented_get
|
||||
#define _pv_missing_set prop_not_implemented_set
|
||||
#define _pv_missing_get prop_not_implemented_get
|
||||
#define _pv_ext_vsn_get prop_not_implemented_get
|
||||
#define _pv_ext_vsn_set prop_not_implemented_set
|
||||
#define _pv_in_use_get prop_not_implemented_get
|
||||
#define _pv_in_use_set prop_not_implemented_set
|
||||
|
||||
|
@ -2554,6 +2554,23 @@ static int _pvmdasize_disp(struct dm_report *rh, struct dm_pool *mem,
|
||||
return _size64_disp(rh, mem, field, &min_mda_size, private);
|
||||
}
|
||||
|
||||
static int _pvextvsn_disp(struct dm_report *rh, struct dm_pool *mem,
|
||||
struct dm_report_field *field,
|
||||
const void *data, void *private)
|
||||
{
|
||||
const struct label *label = (const struct label *) data;
|
||||
struct lvmcache_info *info = label->info;
|
||||
uint32_t ext_version;
|
||||
|
||||
if (info) {
|
||||
ext_version = lvmcache_ext_version(info);
|
||||
return _uint32_disp(rh, mem, field, &ext_version, private);
|
||||
}
|
||||
|
||||
return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
|
||||
}
|
||||
|
||||
|
||||
static int _vgmdasize_disp(struct dm_report *rh, struct dm_pool *mem,
|
||||
struct dm_report_field *field,
|
||||
const void *data, void *private)
|
||||
|
Loading…
Reference in New Issue
Block a user