summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2015-08-24 14:51:20 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2016-02-04 16:20:33 +0100
commitedbcc0030700be4f60faaacf31e1a26cc2c837c2 (patch)
tree69a14473bb92f4ad34ad1c1d8bb5e43e3d242946
parent20643c3bcaf7cfc37b46f085a513fb650ba1e747 (diff)
downloadlvm2-edbcc0030700be4f60faaacf31e1a26cc2c837c2.tar.gz
conf: add metadata/record_removed_entities configuration setting
The metadata/record_removed_entities is a global switch which enables or disables recording removed entities (like dead LVs) in metadata. If both metadata/record_removed_entities=1 lvm.conf option and --nohistory command switch is used at the same time, the --nohistory has higher priority.
-rw-r--r--lib/config/config_settings.h7
-rw-r--r--lib/config/defaults.h1
-rw-r--r--tools/lvmcmdline.c3
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 210a06fa7..d94664bc4 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1360,6 +1360,13 @@ cfg(metadata_check_pv_device_sizes_CFG, "check_pv_device_sizes", metadata_CFG_SE
"less than corresponding PV size. You should not disable this unless\n"
"you are absolutely sure about what you are doing!\n")
+cfg(metadata_record_removed_entities_CFG, "record_removed_entities", metadata_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_RECORD_REMOVED_ENTITIES, vsn(2, 2, 142), NULL, 0, NULL,
+ "When enabled, LVM keeps history records about removed entities in\n"
+ "metadata. The information that is recorded in metadata for removed\n"
+ "entities is reduced when compared to original information kept in\n"
+ "metadata for live entities. Currently, this feature is supported\n"
+ "for thin and thin snapshot LVs only.\n")
+
cfg(metadata_pvmetadatacopies_CFG, "pvmetadatacopies", metadata_CFG_SECTION, CFG_ADVANCED | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_PVMETADATACOPIES, vsn(1, 0, 0), NULL, 0, NULL,
"Number of copies of metadata to store on each PV.\n"
"The --pvmetadatacopies option overrides this setting.\n"
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 080c3ffe0..990429a74 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -127,6 +127,7 @@
#define DEFAULT_FORMAT "lvm2"
#define DEFAULT_STRIPESIZE 64 /* KB */
+#define DEFAULT_RECORD_REMOVED_ENTITIES 0
#define DEFAULT_PVMETADATAIGNORE 0
#define DEFAULT_PVMETADATASIZE 255
#define DEFAULT_PVMETADATACOPIES 1
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index c5dc907fc..6c93da253 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1102,7 +1102,8 @@ static int _get_settings(struct cmd_context *cmd)
cmd->include_foreign_vgs = arg_is_set(cmd, foreign_ARG) ? 1 : 0;
cmd->include_shared_vgs = arg_is_set(cmd, shared_ARG) ? 1 : 0;
cmd->include_dead_entities = arg_is_set(cmd, removed_ARG) ? 1 : 0;
- cmd->record_dead_entities = arg_is_set(cmd, nohistory_ARG) ? 0 : 1;
+ cmd->record_dead_entities = find_config_tree_bool(cmd, metadata_record_removed_entities_CFG, NULL) ?
+ (arg_is_set(cmd, nohistory_ARG) ? 0 : 1) : 0;
/*
* This is set to zero by process_each which wants to print errors