[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] (2/3) tools & missing PV handling



Hi,

this is a naming cleanup of the former tools & partial volume group handling
patch. The handles_partial flag has been renamed to handles_missing_pvs to
separate terminology and clear up the naming mess somewhat.

Fri Jul 11 15:15:50 CEST 2008  me mornfall net
  tagged hotspare: partial metadata 2
Fri Jul 11 14:49:00 CEST 2008  me mornfall net
  tagged hotspare: handles_missing_pvs 1
Fri Jul 11 12:26:37 CEST 2008  me mornfall net
  * Rename handles_partial to handles_missing_pvs.
Thu Mar 13 17:12:17 CET 2008  me mornfall net
  * Don't forget to reset cmd->handles_partial when done.
Fri Feb 15 09:50:19 CET 2008  me mornfall net
  * Make lvremove work on partial VGs.
Thu Feb 14 16:20:07 CET 2008  me mornfall net
  * Add possibility for commands to specify they handle partial VGs.
diff -rN -p -u old-tools-handles_missing_pvs/lib/commands/toolcontext.c new-tools-handles_missing_pvs/lib/commands/toolcontext.c
--- old-tools-handles_missing_pvs/lib/commands/toolcontext.c	2008-07-11 15:20:26.076007770 +0200
+++ new-tools-handles_missing_pvs/lib/commands/toolcontext.c	2008-07-11 15:20:26.128007636 +0200
@@ -936,6 +936,7 @@ struct cmd_context *create_toolcontext(s
 	cmd->args = the_args;
 	cmd->is_static = is_static;
 	cmd->is_long_lived = is_long_lived;
+	cmd->handles_missing_pvs = 0;
 	cmd->hosttags = 0;
 	list_init(&cmd->formats);
 	list_init(&cmd->segtypes);
diff -rN -p -u old-tools-handles_missing_pvs/lib/commands/toolcontext.h new-tools-handles_missing_pvs/lib/commands/toolcontext.h
--- old-tools-handles_missing_pvs/lib/commands/toolcontext.h	2008-07-11 15:20:26.072004101 +0200
+++ new-tools-handles_missing_pvs/lib/commands/toolcontext.h	2008-07-11 15:20:26.128007636 +0200
@@ -68,6 +68,7 @@ struct cmd_context {
 	char **argv;
 	unsigned is_static;	/* Static binary? */
 	unsigned is_long_lived;	/* Optimises persistent_filter handling */
+	unsigned handles_missing_pvs;
 
 	struct dev_filter *filter;
 	int dump_filter;	/* Dump filter when exiting? */
diff -rN -p -u old-tools-handles_missing_pvs/lib/metadata/metadata.c new-tools-handles_missing_pvs/lib/metadata/metadata.c
--- old-tools-handles_missing_pvs/lib/metadata/metadata.c	2008-07-11 15:20:26.072004101 +0200
+++ new-tools-handles_missing_pvs/lib/metadata/metadata.c	2008-07-11 15:20:26.144008696 +0200
@@ -1427,7 +1427,7 @@ int vg_write(struct volume_group *vg)
 		return 0;
 	}
 
-	if (vg_missing_pv_count(vg)) {
+	if (vg_missing_pv_count(vg) && !vg->cmd->handles_missing_pvs) {
 		log_error("Cannot update volume group %s while physical "
 			  "volumes are missing.", vg->name);
 		return 0;
diff -rN -p -u old-tools-handles_missing_pvs/tools/lvmcmdline.c new-tools-handles_missing_pvs/tools/lvmcmdline.c
--- old-tools-handles_missing_pvs/tools/lvmcmdline.c	2008-07-11 15:20:26.072004101 +0200
+++ new-tools-handles_missing_pvs/tools/lvmcmdline.c	2008-07-11 15:20:26.112009649 +0200
@@ -826,6 +826,7 @@ static void _apply_settings(struct cmd_c
 
 	cmd->fmt = arg_ptr_value(cmd, metadatatype_ARG,
 				 cmd->current_settings.fmt);
+	cmd->handles_missing_pvs = 0;
 }
 
 static char *_copy_command_line(struct cmd_context *cmd, int argc, char **argv)
diff -rN -p -u old-tools-handles_missing_pvs/tools/lvremove.c new-tools-handles_missing_pvs/tools/lvremove.c
--- old-tools-handles_missing_pvs/tools/lvremove.c	2008-07-11 15:20:26.072004101 +0200
+++ new-tools-handles_missing_pvs/tools/lvremove.c	2008-07-11 15:20:26.116009198 +0200
@@ -31,6 +31,8 @@ int lvremove(struct cmd_context *cmd, in
 		return EINVALID_CMD_LINE;
 	}
 
+	cmd->handles_missing_pvs = 1;
+
 	return process_each_lv(cmd, argc, argv, LCK_VG_WRITE, NULL,
 			       &lvremove_single);
 }

Yours,
    Petr.

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]