All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Reinitialize backup settings on toolcontext refresh
@ 2010-08-27 12:53 Peter Rajnoha
  0 siblings, 0 replies; only message in thread
From: Peter Rajnoha @ 2010-08-27 12:53 UTC (permalink / raw)
  To: lvm-devel

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);



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-27 12:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-27 12:53 [PATCH] Reinitialize backup settings on toolcontext refresh Peter Rajnoha

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.