[lvm-devel] LVM2/tools vgsplit.c

wysochanski at sourceware.org wysochanski at sourceware.org
Wed Sep 2 21:25:45 UTC 2009


CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski at sourceware.org	2009-09-02 21:25:45

Modified files:
	tools          : vgsplit.c 

Log message:
	Refactor vgsplit to move existing_vg logic in a separate 'if' statement.
	
	This will aid in future refactorings and allow for us to reorder the source
	and destination vg based on alphabetical names.
	Should be no functional change.
	
	Author: Dave Wysochanski <dwysocha at redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.85&r2=1.86

--- LVM2/tools/vgsplit.c	2009/07/14 02:16:05	1.85
+++ LVM2/tools/vgsplit.c	2009/09/02 21:25:44	1.86
@@ -290,6 +290,11 @@
 			goto bad2;
 		}
 
+	} else if (vg_read_error(vg_to) == SUCCESS) {
+		existing_vg = 0;
+	}
+
+	if (existing_vg) {
 		if (new_vg_option_specified(cmd)) {
 			log_error("Volume group \"%s\" exists, but new VG "
 				    "option specified", vg_name_to);
@@ -297,9 +302,7 @@
 		}
 		if (!vgs_are_compatible(cmd, vg_from,vg_to))
 			goto_bad;
-	} else if (vg_read_error(vg_to) == SUCCESS) {
-		existing_vg = 0;
-
+	} else {
 		vp_def.vg_name = NULL;
 		vp_def.extent_size = vg_from->extent_size;
 		vp_def.max_pv = vg_from->max_pv;




More information about the lvm-devel mailing list