From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtMUc-0004TJ-Kl for qemu-devel@nongnu.org; Wed, 18 Dec 2013 14:09:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtMUV-0008D0-AT for qemu-devel@nongnu.org; Wed, 18 Dec 2013 14:09:14 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45070 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtMUV-0008Cv-3r for qemu-devel@nongnu.org; Wed, 18 Dec 2013 14:09:07 -0500 Message-ID: <52B1F2CF.4060400@suse.de> Date: Wed, 18 Dec 2013 20:09:03 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1387386003-8949-1-git-send-email-lcapitulino@redhat.com> <1387386003-8949-11-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1387386003-8949-11-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 10/13] qom: catch errors in object_property_add_child List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino , Paolo Bonzini Cc: Igor Mammedov , qemu-devel@nongnu.org, anthony@codemonkey.ws Am 18.12.2013 18:00, schrieb Luiz Capitulino: > From: Paolo Bonzini >=20 > Signed-off-by: Paolo Bonzini > Reviewed-By: Igor Mammedov > Signed-off-by: Luiz Capitulino > --- > qom/object.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) >=20 > diff --git a/qom/object.c b/qom/object.c > index fc19cf6..68fe07a 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -988,17 +988,22 @@ static void object_finalize_child_property(Object= *obj, const char *name, > void object_property_add_child(Object *obj, const char *name, > Object *child, Error **errp) > { > + Error *local_err =3D NULL; > gchar *type; > =20 > type =3D g_strdup_printf("child<%s>", object_get_typename(OBJECT(c= hild))); > =20 > object_property_add(obj, name, type, object_get_child_property, > - NULL, object_finalize_child_property, child, e= rrp); > - > + NULL, object_finalize_child_property, child, &= local_err); > + if (error_is_set(&local_err)) { I've been told we shouldn't error_is_set() that way but instead write: if (local_err) { No need to respin, but giving me a chance to ack this QOM patch would've been nice. Andreas > + error_propagate(errp, local_err); > + goto out; > + } > object_ref(child); > g_assert(child->parent =3D=3D NULL); > child->parent =3D obj; > =20 > +out: > g_free(type); > } > =20 >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg