summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2016-03-01 15:25:14 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2016-03-03 12:56:55 +0100
commit302895e2c6f00bc34d01332385c3a4f800f482ed (patch)
treef0830939047a1e14987e370015ed22aac49d6527
parent6277aca24130076dbc286cd9dda12747a1776114 (diff)
downloadlvm2-302895e2c6f00bc34d01332385c3a4f800f482ed.tar.gz
cmd: add 'nohistory' option and wire it up in cmd_context
The --nohistory switch will cause historical LVs to not be recorded in metadata on demand.
-rw-r--r--lib/commands/toolcontext.h1
-rw-r--r--tools/args.h1
-rw-r--r--tools/lvmcmdline.c2
3 files changed, 4 insertions, 0 deletions
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index b5328e803..6a6267d1d 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -129,6 +129,7 @@ struct cmd_context {
unsigned independent_metadata_areas:1; /* active formats have MDAs outside PVs */
unsigned unknown_system_id:1;
unsigned include_historical_lvs:1; /* also process/report/display historical LVs */
+ unsigned record_historical_lvs:1; /* record historical LVs */
unsigned include_foreign_vgs:1; /* report/display cmds can reveal foreign VGs */
unsigned include_shared_vgs:1; /* report/display cmds can reveal lockd VGs */
unsigned include_active_foreign_vgs:1; /* cmd should process foreign VGs with active LVs */
diff --git a/tools/args.h b/tools/args.h
index 8dfe7440c..dc7b9e15c 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -69,6 +69,7 @@ arg(mknodes_ARG, '\0', "mknodes", NULL, 0)
arg(monitor_ARG, '\0', "monitor", yes_no_arg, 0)
arg(nameprefixes_ARG, '\0', "nameprefixes", NULL, 0)
arg(noheadings_ARG, '\0', "noheadings", NULL, 0)
+arg(nohistory_ARG, '\0', "nohistory", NULL, 0)
arg(nolocking_ARG, '\0', "nolocking", NULL, 0)
arg(norestorefile_ARG, '\0', "norestorefile", NULL, 0)
arg(nosuffix_ARG, '\0', "nosuffix", NULL, 0)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 4a5cd2355..ffe8447de 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1102,6 +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_historical_lvs = arg_is_set(cmd, history_ARG) ? 1 : 0;
+ cmd->include_historical_lvs = arg_is_set(cmd, history_ARG) ? 1 : 0;
+ cmd->record_historical_lvs = arg_is_set(cmd, nohistory_ARG) ? 0 : 1;
/*
* This is set to zero by process_each which wants to print errors