All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Reinitialize backup settings on toolcontext refresh
Date: Fri, 27 Aug 2010 14:53:18 +0200	[thread overview]
Message-ID: <4C77B53E.2060707@redhat.com> (raw)

This seems to be pretty obvious, but sending it here for a quick check
if anyone sees a problem with this I can't see :)

For example, the bug appears when somone uses '--config "backup { ... }"'.
The values from lvm.conf (or default values) should be overridden but
they're not.

Peter
---
 lib/commands/toolcontext.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 0cf5b8c..20e91b5 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1055,6 +1055,7 @@ static int _init_backup(struct cmd_context *cmd)
 	dir = find_config_tree_str(cmd, "backup/archive_dir",
 			      default_dir);
 
+	archive_exit(cmd);
 	if (!archive_init(cmd, dir, days, min,
 			  cmd->default_settings.archive)) {
 		log_debug("archive_init failed.");
@@ -1076,6 +1077,7 @@ static int _init_backup(struct cmd_context *cmd)
 
 	dir = find_config_tree_str(cmd, "backup/backup_dir", default_dir);
 
+	backup_exit(cmd);
 	if (!backup_init(cmd, dir, cmd->default_settings.backup)) {
 		log_debug("backup_init failed.");
 		return 0;
@@ -1343,6 +1345,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);



                 reply	other threads:[~2010-08-27 12:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C77B53E.2060707@redhat.com \
    --to=prajnoha@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.