1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
Peter Rajnoha 9e3e4d6994 config: differentiate command and metadata profiles and consolidate profile handling code
- When defining configuration source, the code now uses separate
  CONFIG_PROFILE_COMMAND and CONFIG_PROFILE_METADATA markers
  (before, it was just CONFIG_PROFILE that did not make the
  difference between the two). This helps when checking the
  configuration if it contains correct set of options which
  are all in either command-profilable or metadata-profilable
  group without mixing these groups together - so it's a firm
  distinction. The "command profile" can't contain
  "metadata profile" and vice versa! This is strictly checked
  and if the settings are mixed, such profile is rejected and
  it's not used. So in the end, the CONFIG_PROFILE_COMMAND
  set of options and CONFIG_PROFILE_METADATA are mutually exclusive
  sets.

- Marking configuration with one or the other marker will also
  determine the way these configuration sources are positioned
  in the configuration cascade which is now:

  CONFIG_STRING -> CONFIG_PROFILE_COMMAND -> CONFIG_PROFILE_METADATA -> CONFIG_FILE/CONFIG_MERGED_FILES

- Marking configuration with one or the other marker will also make
  it possible to issue a command context refresh (will be probably
  a part of a future patch) if needed for settings in global profile
  set. For settings in metadata profile set this is impossible since
  we can't refresh cmd context in the middle of reading VG/LV metadata
  and for each VG/LV separately because each VG/LV can have a different
  metadata profile assinged and it's not possible to change these
  settings at this level.

- When command profile is incorrect, it's rejected *and also* the
  command exits immediately - the profile *must* be correct for the
  command that was run with a profile to be executed. Before this
  patch, when the profile was found incorrect, there was just the
  warning message and the command continued without profile applied.
  But it's more correct to exit immediately in this case.

- When metadata profile is incorrect, we reject it during command
  runtime (as we know the profile name from metadata and not early
  from command line as it is in case of command profiles) and we
  *do continue* with the command as we're in the middle of operation.
  Also, the metadata profile is applied directly and on the fly on
  find_config_tree_* fn call and even if the metadata profile is
  found incorrect, we still need to return the non-profiled value
  as found in the other configuration provided or default value.
  To exit immediately even in this case, we'd need to refactor
  existing find_config_tree_* fns so they can return error. Currently,
  these fns return only config values (which end up with default
  values in the end if the config is not found).

- To check the profile validity before use to be sure it's correct,
  one can use :

    lvm dumpconfig --commandprofile/--metadataprofile ProfileName --validate

  (the --commandprofile/--metadataprofile for dumpconfig will come
   as part of the subsequent patch)

- This patch also adds a reference to --commandprofile and
  --metadataprofile in the cmd help string (which was missing before
  for the --profile for some commands). We do not mention --profile
  now as people should use --commandprofile or --metadataprofile
  directly. However, the --profile is still supported for backward
  compatibility and it's translated as:

    --profile == --metadataprofile for lvcreate, vgcreate, lvchange and vgchange
                 (as these commands are able to attach profile to metadata)

    --profile == --commandprofile for all the other commands
                (--metadataprofile is not allowed there as it makes no sense)

- This patch also contains some cleanups to make the code handling
  the profiles more readable...
2014-05-20 16:21:48 +02:00
..
activate devmapper: fix compilation without devmapper 2014-04-30 10:26:29 +02:00
cache signals: Move sigint handling out to lvm-signal. 2014-05-01 20:07:17 +01:00
cache_segtype cleanup: modules_needed only for devmapper 2014-04-30 10:26:30 +02:00
commands config: differentiate command and metadata profiles and consolidate profile handling code 2014-05-20 16:21:48 +02:00
config config: differentiate command and metadata profiles and consolidate profile handling code 2014-05-20 16:21:48 +02:00
datastruct cleanup: reduce inclusion of unnecessary headers 2014-04-18 16:38:50 +02:00
device cleanup: constify pointers 2014-05-07 14:17:46 +02:00
display display: print skipped prompt 2014-05-15 12:11:35 +02:00
error cleanup: modules_needed only for devmapper 2014-04-30 10:26:30 +02:00
filters config: add CONFIG_FILE_SPECIAL config source id 2014-05-19 15:37:41 +02:00
format1 format1: Mark obsolete and do not use with lvmetad. 2014-01-14 03:27:45 +00:00
format_pool pvscan: use format feature flags in lvmetad code 2014-01-08 02:13:13 +00:00
format_text config: differentiate command and metadata profiles and consolidate profile handling code 2014-05-20 16:21:48 +02:00
freeseg cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
label cleanup: remove unneeded header files 2014-02-11 19:00:06 +01:00
locking cleanup: drop unused header 2014-05-12 16:24:40 +02:00
log log: skip repeated hashing when logging once 2014-04-08 11:00:14 +02:00
metadata config: differentiate command and metadata profiles and consolidate profile handling code 2014-05-20 16:21:48 +02:00
mirror cleanup: modules_needed only for devmapper 2014-04-30 10:26:30 +02:00
misc configure: drop siginterrupt 2014-05-12 16:24:39 +02:00
mm config: differentiate command and metadata profiles and consolidate profile handling code 2014-05-20 16:21:48 +02:00
properties lvm2app: Add thin and thin pool lv creation 2013-07-12 16:52:16 -05:00
raid cleanup: modules_needed only for devmapper 2014-04-30 10:26:30 +02:00
replicator cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
report cleanup: reduce inclusion of unnecessary headers 2014-04-18 16:38:50 +02:00
snapshot cleanup: modules_needed only for devmapper 2014-04-30 10:26:30 +02:00
striped Add activation/use_linear_target enabled by default. (prajnoha) 2011-11-28 20:37:51 +00:00
thin cleanup: modules_needed only for devmapper 2014-04-30 10:26:30 +02:00
unknown unknown: add_target_line is not needed 2014-04-30 10:26:30 +02:00
uuid cleanup: drop unused define 2014-03-12 19:12:34 +01:00
zero cleanup: modules_needed only for devmapper 2014-04-30 10:26:30 +02:00
Makefile.in locking: Separate out flock and signal code. 2014-05-01 17:37:14 +01:00