Received: from eggs.gnu.org ([2001:4830:134:3::10]:39446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOmoP-0002pY-5o for qemu-devel@nongnu.org; Tue, 02 Sep 2014 08:03:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOmoJ-0005a5-GS for qemu-devel@nongnu.org; Tue, 02 Sep 2014 08:03:49 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:38240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOmoI-0005Vh-QW for qemu-devel@nongnu.org; Tue, 02 Sep 2014 08:03:43 -0400 From: Date: Tue, 2 Sep 2014 20:03:05 +0800 Message-ID: <1409659388-9404-2-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1409659388-9404-1-git-send-email-arei.gonglei@huawei.com> References: <1409659388-9404-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v5 1/4] qdev: using 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: peter.crosthwaite@xilinx.com, weidong.huang@huawei.com, mst@redhat.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, Gonglei , imammedo@redhat.com, pbonzini@redhat.com, afaerber@suse.de From: Gonglei This error can not happen normally. If it happens indicates something very wrong, we should abort QEMU. moreover, The user can only refer to /machine/peripheral, not /machine/unattached. Meanwhile remove superfluous check about local_err. Signed-off-by: Gonglei Reviewed-by: Peter Crosthwaite --- 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 value, Error **errp) } if (value && !dev->realized) { - if (!obj->parent && local_err == NULL) { + if (!obj->parent) { static int unattached_count; gchar *name = g_strdup_printf("device[%d]", unattached_count++); object_property_add_child(container_get(qdev_get_machine(), "/unattached"), - name, obj, &local_err); + name, obj, &error_abort); g_free(name); } -- 1.7.12.4