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

[lvm-devel] [PATCH] (2/6) Tools & missing PV handling



Nothing new in this one, just re-diffed against latest everything.

Tue Jul 29 15:23:49 CEST 2008  me mornfall net
  tagged partial_metadata base
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-29 15:26:48.125490353 +0200
+++ new-tools-handles_missing_pvs/lib/commands/toolcontext.c	2008-07-29 15:26:48.185491202 +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-29 15:26:48.125490353 +0200
+++ new-tools-handles_missing_pvs/lib/commands/toolcontext.h	2008-07-29 15:26:48.185491202 +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-29 15:26:48.125490353 +0200
+++ new-tools-handles_missing_pvs/lib/metadata/metadata.c	2008-07-29 15:26:48.201491983 +0200
@@ -1423,7 +1423,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-29 15:26:48.125490353 +0200
+++ new-tools-handles_missing_pvs/tools/lvmcmdline.c	2008-07-29 15:26:48.165493666 +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-29 15:26:48.125490353 +0200
+++ new-tools-handles_missing_pvs/tools/lvremove.c	2008-07-29 15:26:48.173492625 +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);
 }

-- 
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]