From owner-p4-projects@FreeBSD.ORG Wed Jul 4 16:58:57 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D2BFE16A421; Wed, 4 Jul 2007 16:58:56 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8053016A469 for ; Wed, 4 Jul 2007 16:58:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 71D3613C45D for ; Wed, 4 Jul 2007 16:58:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l64Gwuqf001891 for ; Wed, 4 Jul 2007 16:58:56 GMT (envelope-from lulf@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l64GwuWD001888 for perforce@freebsd.org; Wed, 4 Jul 2007 16:58:56 GMT (envelope-from lulf@FreeBSD.org) Date: Wed, 4 Jul 2007 16:58:56 GMT Message-Id: <200707041658.l64GwuWD001888@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to lulf@FreeBSD.org using -f From: Ulf Lilleengen To: Perforce Change Reviews Cc: Subject: PERFORCE change 122866 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2007 16:58:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=122866 Change 122866 by lulf@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);