diff options
author | Alasdair Kergon <agk@redhat.com> | 2011-09-02 01:32:08 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2011-09-02 01:32:08 +0000 |
commit | c82c2bebed8958456145a3f7ce8a95991e1878c3 (patch) | |
tree | 79fbd3285e05930e7c2751408de8929cff315851 /tools | |
parent | fe8f5dbeb7044ef462c13b3e51329dcec5e2ea05 (diff) | |
download | lvm2-c82c2bebed8958456145a3f7ce8a95991e1878c3.tar.gz |
Move cascade inside libdm etc.
Makes dumpconfig whole-section output wrong in a different way from before,
but we should be able to merge cft_cmdline properly into cmd->cft now and
remove cascade.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lvmcmdline.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 299087436..a8e46b18f 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -996,6 +996,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) { int ret = 0; int locking_type; + struct dm_config_tree *old_cft; init_error_message_produced(0); @@ -1020,8 +1021,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) set_cmd_name(cmd->command->name); if (arg_count(cmd, config_ARG)) - if (override_config_tree_from_string(cmd, - arg_str_value(cmd, config_ARG, ""))) { + if (override_config_tree_from_string(cmd, arg_str_value(cmd, config_ARG, ""))) { ret = EINVALID_CMD_LINE; goto_out; } @@ -1029,10 +1029,9 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) if (arg_count(cmd, config_ARG) || !cmd->config_valid || config_files_changed(cmd)) { /* Reinitialise various settings inc. logging, filters */ if (!refresh_toolcontext(cmd)) { - if (cmd->cft_override) { - destroy_config_tree(cmd->cft_override); - cmd->cft_override = NULL; - } + old_cft = remove_overridden_config_tree(cmd); + if (old_cft) + dm_config_destroy(old_cft); log_error("Updated config file invalid. Aborting."); return ECMD_FAILED; } @@ -1081,9 +1080,8 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) lvmcache_destroy(cmd, 1); } - if (cmd->cft_override) { - destroy_config_tree(cmd->cft_override); - cmd->cft_override = NULL; + if ((old_cft = remove_overridden_config_tree(cmd))) { + dm_config_destroy(old_cft); /* Move this? */ if (!refresh_toolcontext(cmd)) stack; |