PERFORCE change 122866 for review

Ulf Lilleengen lulf at FreeBSD.org
Wed Jul 4 16:58:57 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=122866

Change 122866 by lulf at lulf_carrot on 2007/07/04 16:58:53

	I thought I'd put on a commit message for the last commit as well
	- Use the setstate routines to correctly set the state and give the user
	  notification on what's happening.
	- Remove GV_PLEX_NEWBORN flag when we have configured our plex.
	- Use a GV_EVENT_SETUP_OBJECTS event that is posted after object
	  creation. This might have to be used other places as well, but it
	  seems to be good enough after initial testing.
	
	- This commit includes a fix where the occurence of a error doesn't
	  remove the other objects created.

Affected files ...

.. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum.c#26 edit

Differences ...

==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum.c#26 (text+ko) ====

@@ -325,11 +325,11 @@
 		pp = g_provider_by_name(d2->device);
 		if (pp == NULL) {
 			gctl_error(req, "%s: device not found", d2->device);
-			return (-1);
+			goto error;
 		}
 		if (gv_find_drive(sc, d2->name) != NULL) {
 			gctl_error(req, "drive '%s' already exists", d2->name);
-			return (-1);
+			goto error;
 		}
 
 		d = g_malloc(sizeof(*d), M_WAITOK | M_ZERO);
@@ -346,7 +346,7 @@
 
 		if (gv_find_vol(sc, v2->name) != NULL) {
 			gctl_error(req, "volume '%s' already exists", v2->name);
-			return (-1);
+			goto error;
 		}
 
 		v = g_malloc(sizeof(*v), M_WAITOK | M_ZERO);
@@ -363,7 +363,7 @@
 
 		if (gv_find_plex(sc, p2->name) != NULL) {
 			gctl_error(req, "plex '%s' already exists", p2->name);
-			return (-1);
+			goto error;
 		}
 
 		p = g_malloc(sizeof(*p), M_WAITOK | M_ZERO);
@@ -380,7 +380,7 @@
 
 		if (gv_find_sd(sc, s2->name) != NULL) {
 			gctl_error(req, "sd '%s' already exists", s2->name);
-			return (-1);
+			goto error;
 		}
 
 		s = g_malloc(sizeof(*s), M_WAITOK | M_ZERO);
@@ -389,6 +389,7 @@
 		gv_post_event(sc, GV_EVENT_CREATE_SD, s, NULL, 0, 0);
 	}
 
+error:
 	gv_post_event(sc, GV_EVENT_SETUP_OBJECTS, sc, NULL, 0, 0);
 	gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0);
 


More information about the p4-projects mailing list