Received: from eggs.gnu.org ([2001:4830:134:3::10]:40491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPaj1-0005KI-U4 for qemu-devel@nongnu.org; Thu, 04 Sep 2014 13:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPaij-0006DH-5V for qemu-devel@nongnu.org; Thu, 04 Sep 2014 13:21:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44018 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPaii-0006Cf-Vw for qemu-devel@nongnu.org; Thu, 04 Sep 2014 13:21:17 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 4 Sep 2014 19:21:13 +0200 Message-Id: <1409851275-14941-6-git-send-email-afaerber@suse.de> In-Reply-To: <1409851275-14941-1-git-send-email-afaerber@suse.de> References: <1409851275-14941-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 5/7] qdev: Use error_abort instead of using local_err List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gonglei , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Gonglei This error can not happen normally. If it happens, it indicates something very wrong, we should abort QEMU. Moreover, the user can only refer to /machine/peripheral or /objects, not /machine/unattached. While at it, remove superfluous check about local_err. Signed-off-by: Gonglei Reviewed-by: Peter Crosthwaite Signed-off-by: Andreas F=C3=A4rber --- hw/core/qdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index da1ba48..4a1ac5b 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -820,13 +820,13 @@ static void device_set_realized(Object *obj, bool v= alue, Error **errp) } =20 if (value && !dev->realized) { - if (!obj->parent && local_err =3D=3D NULL) { + if (!obj->parent) { static int unattached_count; gchar *name =3D g_strdup_printf("device[%d]", unattached_cou= nt++); =20 object_property_add_child(container_get(qdev_get_machine(), "/unattached"), - name, obj, &local_err); + name, obj, &error_abort); g_free(name); } =20 --=20 1.8.4.5