From dc8478458ea847b90cfa9b734f63ee5da746c124 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 9 Sep 2010 13:07:13 +0000 Subject: [PATCH] Reinitialize archive and backup handling on toolcontext refresh. For example, when using '--config "backup { ... }"' line, the values from lvm.conf (or default values) should be overridden. This patch adds reinitialisation of archive and backup handling on toolcontext refresh which makes these settings to be applied. --- WHATS_NEW | 1 + lib/commands/toolcontext.c | 3 +++ lib/format_text/archiver.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index dd94cc68e..e55f7a7a7 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.74 - ================================== + Reinitialize archive and backup handling on toolcontext refresh. Fix opprobriously slow I/O to cluster mirrors created with --nosync. Make poll_mirror_progress report PROGRESS_CHECK_FAILED if LV is not a mirror. Like mirrors, don't scan origins if ignore_suspended_devices() is set. diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 0cf5b8cfd..813da9091 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1343,6 +1343,9 @@ int refresh_toolcontext(struct cmd_context *cmd) if (!_init_segtypes(cmd)) return 0; + if (!_init_backup(cmd)) + return 0; + cmd->config_valid = 1; reset_lvm_errno(1); diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c index d8272046d..3ace6281f 100644 --- a/lib/format_text/archiver.c +++ b/lib/format_text/archiver.c @@ -40,6 +40,8 @@ int archive_init(struct cmd_context *cmd, const char *dir, unsigned int keep_days, unsigned int keep_min, int enabled) { + archive_exit(cmd); + if (!(cmd->archive_params = dm_pool_zalloc(cmd->libmem, sizeof(*cmd->archive_params)))) { log_error("archive_params alloc failed"); @@ -156,6 +158,8 @@ int archive_display_file(struct cmd_context *cmd, const char *file) int backup_init(struct cmd_context *cmd, const char *dir, int enabled) { + backup_exit(cmd); + if (!(cmd->backup_params = dm_pool_zalloc(cmd->libmem, sizeof(*cmd->backup_params)))) { log_error("backup_params alloc failed"); -- 2.43.5