mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dumpconfig: add --ignorelocal
When generating a sample lvm.conf file, we don't want to include the "local" section, which is kept in lvmlocal.conf.
This commit is contained in:
parent
0d0d50182d
commit
9b86e8e8f4
@ -1,5 +1,6 @@
|
||||
Version 2.02.119 -
|
||||
==================================
|
||||
Add --ignorelocal option to dumpconfig to ignore the local section.
|
||||
Close connection to lvmetad after fork.
|
||||
Make lvchange able to resume background pvmove polling again.
|
||||
Split pvmove update metadata fn in an initial one and a subsequent one.
|
||||
|
@ -1817,6 +1817,9 @@ struct dm_config_tree *config_def_create_tree(struct config_def_tree_spec *spec)
|
||||
if (cfg_def_get_item_p(id)->parent != root_CFG_SECTION)
|
||||
continue;
|
||||
|
||||
if (spec->ignorelocal && (id == local_CFG_SECTION))
|
||||
continue;
|
||||
|
||||
if ((tmp = _add_def_section_subtree(cft, spec, root, relay, id))) {
|
||||
relay = tmp;
|
||||
if (!root)
|
||||
|
@ -145,6 +145,7 @@ struct config_def_tree_spec {
|
||||
uint16_t version; /* tree at this LVM2 version */
|
||||
unsigned ignoreadvanced:1; /* do not include advanced configs */
|
||||
unsigned ignoreunsupported:1; /* do not include unsupported configs */
|
||||
unsigned ignorelocal:1; /* do not include the local section */
|
||||
unsigned withcomments:1; /* include first line of comment */
|
||||
unsigned withfullcomments:1; /* include all comment lines */
|
||||
unsigned withversions:1; /* include versions */
|
||||
|
@ -11,6 +11,7 @@ lvm-dumpconfig \(em dump LVM configuration
|
||||
.IR version ]
|
||||
.RB [ \-\-ignoreadvanced ]
|
||||
.RB [ \-\-ignoreunsupported ]
|
||||
.RB [ \-\-ignorelocal ]
|
||||
.RB [ \-\-config
|
||||
.IR ConfigurationString ]
|
||||
.RB [ \-\-commandprofile
|
||||
@ -94,6 +95,10 @@ Ignore unsupported configuration settings on dump. These settings are
|
||||
either used for debugging purposes only or their support is not yet
|
||||
complete and they are not meant to be used in production.
|
||||
|
||||
.TP
|
||||
.B \-\-ignorelocal
|
||||
Ignore local section.
|
||||
|
||||
.TP
|
||||
.BI \-\-config " ConfigurationString"
|
||||
Use \fBConfigurationString\fP to override existing configuration.
|
||||
|
@ -43,6 +43,7 @@ arg(errorwhenfull_ARG, '\0', "errorwhenfull", yes_no_arg, 0)
|
||||
arg(force_long_ARG, '\0', "force", NULL, ARG_COUNTABLE)
|
||||
arg(foreign_ARG, '\0', "foreign", NULL, 0)
|
||||
arg(ignoreadvanced_ARG, '\0', "ignoreadvanced", NULL, 0)
|
||||
arg(ignorelocal_ARG, '\0', "ignorelocal", NULL, 0)
|
||||
arg(ignorelockingfailure_ARG, '\0', "ignorelockingfailure", NULL, 0)
|
||||
arg(ignoremonitoring_ARG, '\0', "ignoremonitoring", NULL, 0)
|
||||
arg(ignoreskippedcluster_ARG, '\0', "ignoreskippedcluster", NULL, 0)
|
||||
|
@ -63,6 +63,7 @@ xx(dumpconfig,
|
||||
"\t[--atversion version]]\n"
|
||||
"\t[--ignoreadvanced]\n"
|
||||
"\t[--ignoreunsupported]\n"
|
||||
"\t[--ignorelocal]\n"
|
||||
"\t[--config ConfigurationString]\n"
|
||||
"\t[--commandprofile ProfileName]\n"
|
||||
"\t[--profile ProfileName]\n"
|
||||
@ -75,7 +76,7 @@ xx(dumpconfig,
|
||||
"\t[--withversions]\n"
|
||||
"\t[ConfigurationNode...]\n",
|
||||
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
|
||||
ignoreunsupported_ARG, mergedconfig_ARG, metadataprofile_ARG,
|
||||
ignoreunsupported_ARG, ignorelocal_ARG, mergedconfig_ARG, metadataprofile_ARG,
|
||||
validate_ARG, withcomments_ARG, withfullcomments_ARG, unconfigured_ARG, withversions_ARG)
|
||||
|
||||
xx(formats,
|
||||
|
@ -113,6 +113,9 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
|
||||
if (arg_count(cmd, ignoreunsupported_ARG))
|
||||
tree_spec.ignoreunsupported = 1;
|
||||
|
||||
if (arg_count(cmd, ignorelocal_ARG))
|
||||
tree_spec.ignorelocal = 1;
|
||||
|
||||
if (!strcmp(type, "current")) {
|
||||
if (arg_count(cmd, atversion_ARG)) {
|
||||
log_error("--atversion has no effect with --type current");
|
||||
|
Loading…
Reference in New Issue
Block a user