All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] enable config command line option for backup
@ 2009-04-24 19:09 Takahiro Yasui
  2009-04-24 20:19 ` [PATCH] enable config command line option for backup (update) Takahiro Yasui
  0 siblings, 1 reply; 2+ messages in thread
From: Takahiro Yasui @ 2009-04-24 19:09 UTC (permalink / raw)
  To: lvm-devel

Hi,

This patch enables to configure options related to backup and archive
by "--config" command line option.

Regards,
---
Takahiro Yasui
Hitachi Computer Products (America), Inc.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 lib/commands/toolcontext.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: LVM2.02.46-20090422/lib/commands/toolcontext.c
===================================================================
--- LVM2.02.46-20090422.orig/lib/commands/toolcontext.c
+++ LVM2.02.46-20090422/lib/commands/toolcontext.c
@@ -1160,6 +1160,8 @@ int refresh_toolcontext(struct cmd_conte
 	 */
 
 	activation_release();
+	archive_exit(cmd);
+	backup_exit(cmd);
 	lvmcache_destroy(cmd, 0);
 	label_exit();
 	_destroy_segtypes(&cmd->segtypes);
@@ -1208,6 +1210,9 @@ int refresh_toolcontext(struct cmd_conte
 	if (!_init_segtypes(cmd))
 		return 0;
 
+	if (!_init_backup(cmd))
+		return 0;
+
 	/*
 	 * If we are a long-lived process, write out the updated persistent
 	 * device cache for the benefit of short-lived processes.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] enable config command line option for backup (update)
  2009-04-24 19:09 [PATCH] enable config command line option for backup Takahiro Yasui
@ 2009-04-24 20:19 ` Takahiro Yasui
  0 siblings, 0 replies; 2+ messages in thread
From: Takahiro Yasui @ 2009-04-24 20:19 UTC (permalink / raw)
  To: lvm-devel

Hi,

I fixed memory leak on the previous patch when archive_init()
and backup_init() is called several times.

Regards,
---
Takahiro Yasui
Hitachi Computer Products (America), Inc.



This patch enables to configure options related to backup and archive
by "--config" option in commandline.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 lib/commands/toolcontext.c |    5 +++++
 lib/format_text/archiver.c |   10 ++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

Index: LVM2.02.46-20090422/lib/commands/toolcontext.c
===================================================================
--- LVM2.02.46-20090422.orig/lib/commands/toolcontext.c
+++ LVM2.02.46-20090422/lib/commands/toolcontext.c
@@ -1160,6 +1160,8 @@ int refresh_toolcontext(struct cmd_conte
 	 */
 
 	activation_release();
+	archive_exit(cmd);
+	backup_exit(cmd);
 	lvmcache_destroy(cmd, 0);
 	label_exit();
 	_destroy_segtypes(&cmd->segtypes);
@@ -1208,6 +1210,9 @@ int refresh_toolcontext(struct cmd_conte
 	if (!_init_segtypes(cmd))
 		return 0;
 
+	if (!_init_backup(cmd))
+		return 0;
+
 	/*
 	 * If we are a long-lived process, write out the updated persistent
 	 * device cache for the benefit of short-lived processes.
Index: LVM2.02.46-20090422/lib/format_text/archiver.c
===================================================================
--- LVM2.02.46-20090422.orig/lib/format_text/archiver.c
+++ LVM2.02.46-20090422/lib/format_text/archiver.c
@@ -40,8 +40,9 @@ int archive_init(struct cmd_context *cmd
 		 unsigned int keep_days, unsigned int keep_min,
 		 int enabled)
 {
-	if (!(cmd->archive_params = dm_pool_zalloc(cmd->libmem,
-						sizeof(*cmd->archive_params)))) {
+	if (!cmd->archive_params &&
+	    !(cmd->archive_params = dm_pool_zalloc(cmd->libmem,
+					sizeof(*cmd->archive_params)))) {
 		log_error("archive_params alloc failed");
 		return 0;
 	}
@@ -154,8 +155,9 @@ int archive_display_file(struct cmd_cont
 int backup_init(struct cmd_context *cmd, const char *dir,
 		int enabled)
 {
-	if (!(cmd->backup_params = dm_pool_zalloc(cmd->libmem,
-					       sizeof(*cmd->backup_params)))) {
+	if (!cmd->backup_params &&
+	    !(cmd->backup_params = dm_pool_zalloc(cmd->libmem,
+					sizeof(*cmd->backup_params)))) {
 		log_error("backup_params alloc failed");
 		return 0;
 	}



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-24 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-24 19:09 [PATCH] enable config command line option for backup Takahiro Yasui
2009-04-24 20:19 ` [PATCH] enable config command line option for backup (update) Takahiro Yasui

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.