master - dumpconfig: add --ignorelocal
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9b86e8e8f4a3c429f8e5632103fbef6eb1f8dc7d Commit: 9b86e8e8f4a3c429f8e5632103fbef6eb1f8dc7d Parent: 0d0d50182d1bf6b11b80fe8fe701f654b953f2fa Author: David Teigland <[email protected]> AuthorDate: Tue Apr 21 14:53:54 2015 -0500 Committer: David Teigland <[email protected]> CommitterDate: Tue Apr 21 14:55:03 2015 -0500
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.
--- WHATS_NEW | 1 + lib/config/config.c | 3 +++ lib/config/config.h | 1 + man/lvm-dumpconfig.8.in | 5 +++++ tools/args.h | 1 + tools/commands.h | 3 ++- tools/dumpconfig.c | 3 +++ 7 files changed, 16 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
@@ -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.
lib/config/config.c +3 -0
@@ -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)
lib/config/config.h +1 -0
@@ -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 */
man/lvm-dumpconfig.8.in +5 -0
@@ -11,6 +11,7 @@ lvm-dumpconfig \(em dump LVM configuration .IR version ] .RB [ \-\-ignoreadvanced ] .RB [ \-\-ignoreunsupported ] +.RB [ \-\-ignorelocal ] .RB [ \-\-config .IR ConfigurationString ] .RB [ \-\-commandprofile
@@ -95,6 +96,10 @@ 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. This configuration is then applied for dumpconfig command itself.
tools/args.h +1 -0
@@ -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 )
tools/commands.h +2 -1
@@ -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,
tools/dumpconfig.c +3 -0
@@ -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" );