1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-14 15:33:15 +03:00

Remove archive_enable() calls after create_toolcontext() calls.

_init_backup() calls archive_init(), which originally set 'enabled' to
a hardcoded '1' value.  This seems incorrect based on my read of other
areas of the code so here we add a 'enabled' paramter to archive_init().
We pass in cmd->default_settings.archive, which is obtained from the
config tree.  Later in create_toolcontext, cmd->current_settings is
set to cmd->default_settings.  The archive_enable() call we remove
here was using cmd->current_settings to set the 'archive' enable
value.  The final value of cmd->archive_params->enabled should thus
be equivalent to the original code.
This commit is contained in:
Dave Wysochanski
2008-12-11 03:32:56 +00:00
parent 76d734a4bd
commit 6f36d0d06c
5 changed files with 8 additions and 7 deletions

View File

@@ -926,7 +926,7 @@ static int _init_backup(struct cmd_context *cmd)
if (!cmd->sys_dir) {
log_warn("WARNING: Metadata changes will NOT be backed up");
backup_init(cmd, "");
archive_init(cmd, "", 0, 0);
archive_init(cmd, "", 0, 0, 0);
return 1;
}
@@ -952,7 +952,8 @@ static int _init_backup(struct cmd_context *cmd)
dir = find_config_tree_str(cmd, "backup/archive_dir",
default_dir);
if (!archive_init(cmd, dir, days, min)) {
if (!archive_init(cmd, dir, days, min,
cmd->default_settings.archive)) {
log_debug("backup_init failed.");
return 0;
}