]> sourceware.org Git - lvm2.git/commitdiff
Reinitialize archive and backup handling on toolcontext refresh.
authorPeter Rajnoha <prajnoha@redhat.com>
Thu, 9 Sep 2010 13:07:13 +0000 (13:07 +0000)
committerPeter Rajnoha <prajnoha@redhat.com>
Thu, 9 Sep 2010 13:07:13 +0000 (13:07 +0000)
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
lib/commands/toolcontext.c
lib/format_text/archiver.c

index dd94cc68e86089f702e27acb5e33d8d427af5e0b..e55f7a7a75a8e4a52b51320daad4bd07fc2eac7e 100644 (file)
--- 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.
index 0cf5b8cfd67888ef99e3ec57379dc505439e8050..813da909137a58adb0392c838e51af7813cfd315 100644 (file)
@@ -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);
index d8272046dcf22c7b4e2f89d02dc8dfd0a92d8668..3ace6281f51a910de4bb336669c9563595c31069 100644 (file)
@@ -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");
This page took 0.048905 seconds and 5 git commands to generate.