diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2013-03-05 17:36:10 +0100 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2013-03-06 10:46:35 +0100 |
commit | 245b85692ec9f30153c1aa7216d81e65bb132792 (patch) | |
tree | 784d8017610b9fbec9cd2ca79ed91908ea0a2a80 /doc | |
parent | e38aaddb5e72a2123a03dedbb40c2aa594495c17 (diff) | |
download | lvm2-245b85692ec9f30153c1aa7216d81e65bb132792.tar.gz |
config: use config checks and add support for creating trees from config definition (config_def_create_tree fn)
Configuration checking is initiated during config load/processing
(_process_config fn) which is part of the command context
creation/refresh.
This patch also defines 5 types of trees that could be created from
the configuration definition (config_settings.h), the cfg_def_tree_t:
- CFG_DEF_TREE_CURRENT that denotes a tree of all the configuration
nodes that are explicitly defined in lvm.conf/--config
- CFG_DEF_TREE_MISSING that denotes a tree of all missing
configuration nodes for which default valus are used since they're
not explicitly used in lvm.conf/--config
- CFG_DEF_TREE_DEFAULT that denotes a tree of all possible
configuration nodes with default values assigned, no matter what
the actual lvm.conf/--config is
- CFG_DEF_TREE_NEW that denotes a tree of all new configuration nodes
that appeared in given version
- CFG_DEF_TREE_COMPLETE that denotes a tree of the whole configuration
tree that is used in LVM2 (a combination of CFG_DEF_TREE_CURRENT +
CFG_DEF_TREE_MISSING). This is not implemented yet, it will be added
later...
The function that creates the definition tree of given type:
struct dm_config_tree *config_def_create_tree(struct config_def_tree_spec *spec);
Where the "spec" specifies the tree type to be created:
struct config_def_tree_spec {
cfg_def_tree_t type; /* tree type */
uint16_t version; /* tree at this LVM2 version */
int ignoreadvanced; /* do not include advanced configs */
int ignoreunsupported; /* do not include unsupported configs */
};
This tree can be passed to already existing functions that write
the tree on output (like we already do with cmd->cft).
There is a new lvm.conf section called "config" with two new options:
- config/checks which enables/disables checking (enabled by default)
- config/abort_on_errors which enables/disables aborts on any type of
mismatch found in the config (disabled by default)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/example.conf.in | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/example.conf.in b/doc/example.conf.in index ab83c0c7c..9670b92fe 100644 --- a/doc/example.conf.in +++ b/doc/example.conf.in @@ -10,6 +10,20 @@ # N.B. Take care that each setting only appears once if uncommenting # example settings in this file. +# This section allows you to set the way the configuration settings are handled. +config { + + # If enabled, any LVM2 configuration mismatch is reported. + # This implies checking that the configuration key is understood + # by LVM2 and that the value of the key is of a proper type. + # If disabled, any configuration mismatch is ignored and default + # value is used instead without any warning (a message about the + # configuration key not being found is issued in verbose mode only). + checks = 1 + + # If enabled, any configuration mismatch aborts the LVM2 process. + abort_on_errors = 0 +} # This section allows you to configure which block devices should # be used by the LVM system. @@ -359,7 +373,6 @@ shell { # Miscellaneous global LVM2 settings global { - # The file creation mask for any files and directories created. # Interpreted as octal if the first digit is zero. umask = 077 |