1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
Peter Rajnoha 245b85692e 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)
2013-03-06 10:46:35 +01:00
..
activate config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
cache lvmetad: fix to properly process embedding area 2013-02-27 10:36:49 +01:00
commands config: use config checks and add support for creating trees from config definition (config_def_create_tree fn) 2013-03-06 10:46:35 +01:00
config config: use config checks and add support for creating trees from config definition (config_def_create_tree fn) 2013-03-06 10:46:35 +01:00
datastruct Switch to return void 2012-02-08 12:52:58 +00:00
device config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
display config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
error cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
filters filters: add scm devices 2013-01-11 09:24:07 +01:00
format1 pv_header_extension: add support for writing PV header extension (flags & Embedding Area) 2013-02-26 11:28:00 +01:00
format_pool cleanup: use struct pvcreate_restorable_params throughout 2013-02-26 11:25:11 +01:00
format_text config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
freeseg cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
label logging: classify log_debug messages 2013-01-07 22:30:29 +00:00
locking config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
log logging: add debug classes 2013-01-07 22:25:19 +00:00
metadata config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
mirror config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
misc config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
mm config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
raid config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
replicator cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
report report: add reporting fields for Embedding Area start and size 2013-02-26 14:46:42 +01:00
snapshot config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
striped Add activation/use_linear_target enabled by default. (prajnoha) 2011-11-28 20:37:51 +00:00
thin config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
unknown cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
uuid Revert the #include changes. Need to fix this at the #include site for now, and 2011-07-18 14:34:33 +00:00
zero cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
Makefile.in cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00