diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2016-08-08 11:57:13 +0200 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2016-08-08 11:57:13 +0200 |
commit | 57fa5d4329e9152ff689b510f16a237e2f85c903 (patch) | |
tree | b2c23942486f57319c355eb353737d485fe99503 | |
parent | 76ef2d15d839106adac4d82005d517be05a657eb (diff) | |
download | lvm2-57fa5d4329e9152ff689b510f16a237e2f85c903.tar.gz |
lvmcmdline: do not refresh whole cmd context if profile dropped after processing LVM cmd
We don't need to refresh whole cmd context if we drop profile after
processing LVM command - just like we don't refresh cmd context when
we're applying the profile. It's because profiles contain only safe
subset of settings which do not require complete cmd context refresh.
This patch calls process_profilable_config instead of
refresh_toolcontext if there was profile applied for the LVM
command only, not --config which requires toolcontext refresh.
The process_profilable_config just sets proper values based on
values of profilable settings, but it does not do complete
reinitialization of various parts (e.g. filters, logging etc.).
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | tools/lvmcmdline.c | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,6 @@ Version 2.02.163 - ================================= + Do not refresh whole cmd context if profile dropped after processing LVM cmd. Support straightforward lvconvert between striped and raid4 LVs. Support straightforward lvconvert between raid1 and mirror LVs. Report supported conversions when asked for unsupported raid lvconvert. diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 4ad2ea6b4..3c3498a17 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -1734,10 +1734,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) config_profile_metadata_cft = remove_config_tree_by_source(cmd, CONFIG_PROFILE_METADATA); cmd->profile_params->global_metadata_profile = NULL; - if (config_string_cft || config_profile_command_cft || config_profile_metadata_cft) { + if (config_string_cft) { /* Move this? */ if (!refresh_toolcontext(cmd)) stack; + } else if (config_profile_command_cft || config_profile_metadata_cft) { + if (!process_profilable_config(cmd)) + stack; } if (ret == EINVALID_CMD_LINE && !cmd->is_interactive) |