1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Remove backup_enable() calls after create_toolcontext() calls.

Identical argument to previous patch which removed archive_enable() calls.
We add a new parameter to backup_init() which sets the enable value based
on the cmd->default_settings.backup value.  This value was used to set
cmd->current_settings.backup, used in the removed backup_enable() call.
This commit is contained in:
Dave Wysochanski 2008-12-11 03:33:35 +00:00
parent 6f36d0d06c
commit 13aad7e8b4
5 changed files with 6 additions and 7 deletions

View File

@ -733,7 +733,6 @@ int init_lvm(int using_gulm)
init_syslog(LOG_DAEMON);
openlog("clvmd", LOG_PID, LOG_DAEMON);
set_activation(cmd->current_settings.activation);
backup_enable(cmd, cmd->current_settings.backup);
cmd->cmd_line = (char *)"clvmd";
/* Check lvm.conf is setup for cluster-LVM */

View File

@ -925,7 +925,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, "");
backup_init(cmd, "", 0);
archive_init(cmd, "", 0, 0, 0);
return 1;
}
@ -973,7 +973,7 @@ static int _init_backup(struct cmd_context *cmd)
dir = find_config_tree_str(cmd, "backup/backup_dir", default_dir);
if (!backup_init(cmd, dir)) {
if (!backup_init(cmd, dir, cmd->default_settings.backup)) {
log_debug("backup_init failed.");
return 0;
}

View File

@ -150,7 +150,8 @@ int archive_display_file(struct cmd_context *cmd, const char *file)
return r;
}
int backup_init(struct cmd_context *cmd, const char *dir)
int backup_init(struct cmd_context *cmd, const char *dir,
int enabled)
{
if (!(cmd->backup_params = dm_pool_zalloc(cmd->libmem,
sizeof(*cmd->archive_params)))) {
@ -166,6 +167,7 @@ int backup_init(struct cmd_context *cmd, const char *dir)
log_error("Couldn't copy backup directory name.");
return 0;
}
backup_enable(cmd, enabled);
return 1;
}

View File

@ -41,7 +41,7 @@ int archive(struct volume_group *vg);
int archive_display(struct cmd_context *cmd, const char *vg_name);
int archive_display_file(struct cmd_context *cmd, const char *file);
int backup_init(struct cmd_context *cmd, const char *dir);
int backup_init(struct cmd_context *cmd, const char *dir, int enabled);
void backup_exit(struct cmd_context *cmd);
void backup_enable(struct cmd_context *cmd, int flag);

View File

@ -1097,8 +1097,6 @@ struct cmd_context *init_lvm(unsigned is_static)
init_msg_prefix(cmd->default_settings.msg_prefix);
init_cmd_name(cmd->default_settings.cmd_name);
backup_enable(cmd, cmd->current_settings.backup);
set_activation(cmd->current_settings.activation);
cmd->fmt = arg_ptr_value(cmd, metadatatype_ARG,