public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW tools/vgremove.c
@ 2010-01-08 14:03 mornfall
  0 siblings, 0 replies; 2+ messages in thread
From: mornfall @ 2010-01-08 14:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2010-01-08 14:03:55

Modified files:
	.              : WHATS_NEW 
	tools          : vgremove.c 

Log message:
	Allow vgremove of a VG with PVs missing.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1373&r2=1.1374
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgremove.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59

--- LVM2/WHATS_NEW	2010/01/07 20:55:01	1.1373
+++ LVM2/WHATS_NEW	2010/01/08 14:03:54	1.1374
@@ -1,5 +1,6 @@
 Version 2.02.57 -
 ====================================
+  Allow vgremove of a VG with PVs missing.
   Keep log type consistent when changing mirror image count.
   Always set environment variables for an LVM2 device in 11-dm-lvm.rules.
   Add activation/udev_rules config option in lvm.conf.
--- LVM2/tools/vgremove.c	2009/12/03 19:18:34	1.58
+++ LVM2/tools/vgremove.c	2010/01/08 14:03:55	1.59
@@ -19,7 +19,7 @@
 			   struct volume_group *vg,
 			   void *handle __attribute((unused)))
 {
-	unsigned lv_count;
+	unsigned lv_count, missing;
 	force_t force;
 
 	if (!vg_check_status(vg, EXPORTED_VG)) {
@@ -31,13 +31,17 @@
 
 	force = arg_count(cmd, force_ARG);
 	if (lv_count) {
-		if ((force == PROMPT) &&
-		    (yes_no_prompt("Do you really want to remove volume "
-				   "group \"%s\" containing %u "
-				   "logical volumes? [y/n]: ",
-				   vg_name, lv_count) == 'n')) {
-			log_error("Volume group \"%s\" not removed", vg_name);
-			return ECMD_FAILED;
+		if (force == PROMPT) {
+			if ((missing = vg_missing_pv_count(vg)))
+				log_warn("WARNING: %d physical volumes are currently missing "
+					 "from the system.", missing);
+			if (yes_no_prompt("Do you really want to remove volume "
+					  "group \"%s\" containing %u "
+					  "logical volumes? [y/n]: ",
+					  vg_name, lv_count) == 'n') {
+				log_error("Volume group \"%s\" not removed", vg_name);
+				return ECMD_FAILED;
+			}
 		}
 		if (!remove_lvs_in_vg(cmd, vg, force)) {
 			stack;
@@ -67,6 +71,7 @@
 		return EINVALID_CMD_LINE;
 	}
 
+	cmd->handles_missing_pvs = 1;
 	ret = process_each_vg(cmd, argc, argv,
 			      READ_FOR_UPDATE,
 			      NULL, &vgremove_single);


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

* LVM2 ./WHATS_NEW tools/vgremove.c
@ 2007-03-15 14:00 mbroz
  0 siblings, 0 replies; 2+ messages in thread
From: mbroz @ 2007-03-15 14:00 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2007-03-15 14:00:31

Modified files:
	.              : WHATS_NEW 
	tools          : vgremove.c 

Log message:
	Fix vgremove to require at least one vg argument.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.586&r2=1.587
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgremove.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38

--- LVM2/WHATS_NEW	2007/03/15 13:38:27	1.586
+++ LVM2/WHATS_NEW	2007/03/15 14:00:29	1.587
@@ -1,5 +1,6 @@
 Version 2.02.24 -
 ====================================
+  Fix vgremove to require at least one vg argument.
   Fix reading of striped LVs in LVM1 format.
   Flag nolocking as clustered so clvmd startup sees clustered LVs. (2.02.10)
   Add a few missing pieces of vgname command line validation.
--- LVM2/tools/vgremove.c	2006/05/09 21:23:51	1.37
+++ LVM2/tools/vgremove.c	2007/03/15 14:00:30	1.38
@@ -87,6 +87,11 @@
 {
 	int ret;
 
+	if (!argc) {
+		log_error("Please enter one or more volume group paths");
+		return EINVALID_CMD_LINE;
+	}
+
 	if (!lock_vol(cmd, ORPHAN, LCK_VG_WRITE)) {
 		log_error("Can't get lock for orphan PVs");
 		return ECMD_FAILED;


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

end of thread, other threads:[~2010-01-08 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-08 14:03 LVM2 ./WHATS_NEW tools/vgremove.c mornfall
  -- strict thread matches above, loose matches on Subject: below --
2007-03-15 14:00 mbroz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).