Skip to contentSkip to conversation

Fix vgremove to allow removal of VG with missing PVs.

PATCH New Milan Broz 2 participants 3 messages Jun 30, 2010

lore
Share & tools
lore

Milan Broz

author
#0 lore raw

PATCH 1/1 Fix vgremove to allow removal of VG with missing PVs.

Inroduced by vgremove check function split...

---
 WHATS_NEW                  |    1 +
 test/t-activate-partial.sh |    3 +++
 tools/vgremove.c           |    2 +-
 3 files changed, 5 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index 0c415a3..b485a59 100644
@@ -1,5 +1,6 @@
 Version 2.02.69 - 
 ================================
+  Fix vgremove to allow removal of VG with missing PVs. (2.02.52)
   Add {pv|vg}_mda_used_count which displays a count of mdas w/ignored bit clear.
   Add vg_mda_copies which displays the value of --vgmetadatacopies.
   Describe --vgmetadatacopies in lvm.conf and other man pages.
test/t-activate-partial.sh +3 -0
index f0a95c5..15f5965 100644
@@ -15,3 +15,6 @@ lvchange -v --refresh --partial $vg/mirror
 # also check that vgchange works
 vgchange -a n --partial $vg
 vgchange -a y --partial $vg
+
+# check vgremove
+vgremove -f $vg
\ No newline at end of file
tools/vgremove.c +1 -1
index b719ca2..56e18ef 100644
@@ -49,7 +49,7 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name,
 		}
 	}
 
-	if (!vg_remove_check(vg)) {
+	if (!force && !vg_remove_check(vg)) {
 		stack;
 		return ECMD_FAILED;
 	}
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 Fix vgremove to allow removal of VG with missing PVs.

Hi,

Quoted 28 lines · Milan Broz
WHATS_NEW +1 -0
index 0c415a3..b485a59 100644
@@ -1,5 +1,6 @@
 Version 2.02.69 - 
 ================================
+  Fix vgremove to allow removal of VG with missing PVs. (2.02.52)
   Add {pv|vg}_mda_used_count which displays a count of mdas w/ignored bit clear.
   Add vg_mda_copies which displays the value of --vgmetadatacopies.
   Describe --vgmetadatacopies in lvm.conf and other man pages.
test/t-activate-partial.sh +3 -0
index f0a95c5..15f5965 100644
@@ -15,3 +15,6 @@ lvchange -v --refresh --partial $vg/mirror
 # also check that vgchange works
 vgchange -a n --partial $vg
 vgchange -a y --partial $vg
+
+# check vgremove
+vgremove -f $vg
\ No newline at end of file
tools/vgremove.c +0 -0
index b719ca2..56e18ef 100644

tools/vgremove.c static int vgremove_single(struct cmd_context *cmd, const char *vg_name, · line 55

Quoted 8 lines
tools/vgremove.c +1 -1
@@ -49,7 +49,7 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name,
 		}
 	}
 
-	if (!vg_remove_check(vg)) {
+	if (!force && !vg_remove_check(vg)) {
 		stack;
 		return ECMD_FAILED;
 	}

Looks OK as far as I can tell. Maybe just add "not vgremove $vg" just before "vgremove -f $vg" in the test.

Yours,
Petr.

author
#2 lore raw

PATCH 1/1 Fix vgremove to allow removal of VG with missing PVs.

Quoted 2 lines · Petr Rockai

Looks OK as far as I can tell. Maybe just add "not vgremove $vg" just before "vgremove -f $vg" in the test.

then it asks interactively because -f is overloaded here to disable lv removal question also:-)

There should be -y added, but it is for another patch probably.

Milan