mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
vgs: add report field for shared
equivalent to a non-empty -o locktype.
This commit is contained in:
parent
2beb3009bd
commit
fdaa7e2e87
@ -1310,6 +1310,7 @@ int validate_vg_rename_params(struct cmd_context *cmd,
|
|||||||
const char *vg_name_new);
|
const char *vg_name_new);
|
||||||
|
|
||||||
int is_lockd_type(const char *lock_type);
|
int is_lockd_type(const char *lock_type);
|
||||||
|
int vg_is_shared(const struct volume_group *vg);
|
||||||
|
|
||||||
int is_system_id_allowed(struct cmd_context *cmd, const char *system_id);
|
int is_system_id_allowed(struct cmd_context *cmd, const char *system_id);
|
||||||
|
|
||||||
|
@ -6052,6 +6052,11 @@ int is_lockd_type(const char *lock_type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int vg_is_shared(const struct volume_group *vg)
|
||||||
|
{
|
||||||
|
return (vg->lock_type && is_lockd_type(vg->lock_type));
|
||||||
|
}
|
||||||
|
|
||||||
int vg_strip_outdated_historical_lvs(struct volume_group *vg) {
|
int vg_strip_outdated_historical_lvs(struct volume_group *vg) {
|
||||||
struct glv_list *glvl, *tglvl;
|
struct glv_list *glvl, *tglvl;
|
||||||
time_t current_time = time(NULL);
|
time_t current_time = time(NULL);
|
||||||
|
@ -211,6 +211,7 @@ FIELD(VGS, vg, BIN, "Exported", cmd, 10, vgexported, vg_exported, "Set if VG is
|
|||||||
FIELD(VGS, vg, BIN, "Partial", cmd, 10, vgpartial, vg_partial, "Set if VG is partial.", 0)
|
FIELD(VGS, vg, BIN, "Partial", cmd, 10, vgpartial, vg_partial, "Set if VG is partial.", 0)
|
||||||
FIELD(VGS, vg, STR, "AllocPol", cmd, 10, vgallocationpolicy, vg_allocation_policy, "VG allocation policy.", 0)
|
FIELD(VGS, vg, STR, "AllocPol", cmd, 10, vgallocationpolicy, vg_allocation_policy, "VG allocation policy.", 0)
|
||||||
FIELD(VGS, vg, BIN, "Clustered", cmd, 10, vgclustered, vg_clustered, "Set if VG is clustered.", 0)
|
FIELD(VGS, vg, BIN, "Clustered", cmd, 10, vgclustered, vg_clustered, "Set if VG is clustered.", 0)
|
||||||
|
FIELD(VGS, vg, BIN, "Shared", cmd, 7, vgshared, vg_shared, "Set if VG is shared.", 0)
|
||||||
FIELD(VGS, vg, SIZ, "VSize", cmd, 0, vgsize, vg_size, "Total size of VG in current units.", 0)
|
FIELD(VGS, vg, SIZ, "VSize", cmd, 0, vgsize, vg_size, "Total size of VG in current units.", 0)
|
||||||
FIELD(VGS, vg, SIZ, "VFree", cmd, 0, vgfree, vg_free, "Total amount of free space in current units.", 0)
|
FIELD(VGS, vg, SIZ, "VFree", cmd, 0, vgfree, vg_free, "Total amount of free space in current units.", 0)
|
||||||
FIELD(VGS, vg, STR, "SYS ID", cmd, 0, vgsystemid, vg_sysid, "System ID of the VG indicating which host owns it.", 0)
|
FIELD(VGS, vg, STR, "SYS ID", cmd, 0, vgsystemid, vg_sysid, "System ID of the VG indicating which host owns it.", 0)
|
||||||
|
@ -213,6 +213,8 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
|
|||||||
#define _vg_allocation_policy_get prop_not_implemented_get
|
#define _vg_allocation_policy_get prop_not_implemented_get
|
||||||
#define _vg_clustered_set prop_not_implemented_set
|
#define _vg_clustered_set prop_not_implemented_set
|
||||||
#define _vg_clustered_get prop_not_implemented_get
|
#define _vg_clustered_get prop_not_implemented_get
|
||||||
|
#define _vg_shared_set prop_not_implemented_set
|
||||||
|
#define _vg_shared_get prop_not_implemented_get
|
||||||
|
|
||||||
#define _lv_layout_set prop_not_implemented_set
|
#define _lv_layout_set prop_not_implemented_set
|
||||||
#define _lv_layout_get prop_not_implemented_get
|
#define _lv_layout_get prop_not_implemented_get
|
||||||
|
@ -3385,6 +3385,14 @@ static int _vgclustered_disp(struct dm_report *rh, struct dm_pool *mem,
|
|||||||
return _binary_disp(rh, mem, field, clustered, GET_FIRST_RESERVED_NAME(vg_clustered_y), private);
|
return _binary_disp(rh, mem, field, clustered, GET_FIRST_RESERVED_NAME(vg_clustered_y), private);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _vgshared_disp(struct dm_report *rh, struct dm_pool *mem,
|
||||||
|
struct dm_report_field *field,
|
||||||
|
const void *data, void *private)
|
||||||
|
{
|
||||||
|
int shared = (vg_is_shared((const struct volume_group *) data)) != 0;
|
||||||
|
return _binary_disp(rh, mem, field, shared, GET_FIRST_RESERVED_NAME(vg_shared_y), private);
|
||||||
|
}
|
||||||
|
|
||||||
static int _lvlayout_disp(struct dm_report *rh, struct dm_pool *mem,
|
static int _lvlayout_disp(struct dm_report *rh, struct dm_pool *mem,
|
||||||
struct dm_report_field *field,
|
struct dm_report_field *field,
|
||||||
const void *data, void *private)
|
const void *data, void *private)
|
||||||
|
@ -60,6 +60,7 @@ FIELD_RESERVED_BINARY_VALUE(vg_extendable, vg_extendable, "", "extendable")
|
|||||||
FIELD_RESERVED_BINARY_VALUE(vg_exported, vg_exported, "", "exported")
|
FIELD_RESERVED_BINARY_VALUE(vg_exported, vg_exported, "", "exported")
|
||||||
FIELD_RESERVED_BINARY_VALUE(vg_partial, vg_partial, "", "partial")
|
FIELD_RESERVED_BINARY_VALUE(vg_partial, vg_partial, "", "partial")
|
||||||
FIELD_RESERVED_BINARY_VALUE(vg_clustered, vg_clustered, "", "clustered")
|
FIELD_RESERVED_BINARY_VALUE(vg_clustered, vg_clustered, "", "clustered")
|
||||||
|
FIELD_RESERVED_BINARY_VALUE(vg_shared, vg_shared, "", "shared")
|
||||||
FIELD_RESERVED_VALUE(NAMED, vg_permissions, vg_permissions_rw, "", "writeable", "writeable", "rw", "read-write")
|
FIELD_RESERVED_VALUE(NAMED, vg_permissions, vg_permissions_rw, "", "writeable", "writeable", "rw", "read-write")
|
||||||
FIELD_RESERVED_VALUE(NAMED, vg_permissions, vg_permissions_r, "", "read-only", "read-only", "r", "ro")
|
FIELD_RESERVED_VALUE(NAMED, vg_permissions, vg_permissions_r, "", "read-only", "read-only", "r", "ro")
|
||||||
FIELD_RESERVED_VALUE(NOFLAG, vg_mda_copies, vg_mda_copies_unmanaged, "", &GET_TYPE_RESERVED_VALUE(num_undef_64), "unmanaged")
|
FIELD_RESERVED_VALUE(NOFLAG, vg_mda_copies, vg_mda_copies_unmanaged, "", &GET_TYPE_RESERVED_VALUE(num_undef_64), "unmanaged")
|
||||||
|
Loading…
Reference in New Issue
Block a user