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:
parent
6f36d0d06c
commit
13aad7e8b4
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user