diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2013-03-06 09:35:33 +0100 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2013-03-06 10:46:36 +0100 |
commit | 7d6991e900cbd5959e73285af81079bc22eadccb (patch) | |
tree | 1c8ac3d8cc7928b0de96dbd237d33ad247e0d490 /tools/dumpconfig.c | |
parent | 7fd04bd93a1ea3e86c90c396151424719f3e1b63 (diff) | |
download | lvm2-7d6991e900cbd5959e73285af81079bc22eadccb.tar.gz |
dumpconfig: add --ignoreadvanced and --ignoreunsupported switch
lvm dumpconfig [--ignoreadvanced] [--ignoreunsupported]
--ignoreadvanced causes the advanced configuration options to be left
out on dumpconfig output
--ignoreunsupported causes the options that are not officially supported
to be lef out on dumpconfig output
Diffstat (limited to 'tools/dumpconfig.c')
-rw-r--r-- | tools/dumpconfig.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c index 384f52df1..a340eb071 100644 --- a/tools/dumpconfig.c +++ b/tools/dumpconfig.c @@ -50,6 +50,12 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv) return EINVALID_CMD_LINE; } + if (arg_count(cmd, ignoreadvanced_ARG)) + tree_spec.ignoreadvanced = 1; + + if (arg_count(cmd, ignoreunsupported_ARG)) + tree_spec.ignoreunsupported = 1; + if (arg_count(cmd, validate_ARG)) { if (config_def_check(cmd, 1, 1, 0)) { log_print("LVM configuration valid."); @@ -82,6 +88,12 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv) return EINVALID_CMD_LINE; } + if ((tree_spec.ignoreadvanced || tree_spec.ignoreunsupported) && + (tree_spec.type == CFG_DEF_TREE_CURRENT)) { + log_error("--ignoreadvanced and --ignoreunsupported has no effect with --type current"); + return EINVALID_CMD_LINE; + } + if (tree_spec.type != CFG_DEF_TREE_CURRENT) { if (!_get_vsn(cmd, &major, &minor, &patchlevel)) return EINVALID_CMD_LINE; |