From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X48Bu-0003m5-2B for qemu-devel@nongnu.org; Mon, 07 Jul 2014 08:38:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X48Bm-0000fm-Ff for qemu-devel@nongnu.org; Mon, 07 Jul 2014 08:38:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X48Bl-0000fX-SK for qemu-devel@nongnu.org; Mon, 07 Jul 2014 08:38:34 -0400 Date: Mon, 7 Jul 2014 15:40:35 +0300 From: "Michael S. Tsirkin" Message-ID: <1404711994-18228-10-git-send-email-mst@redhat.com> References: <1404711994-18228-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1404711994-18228-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 09/12] qdev: Don't abort() in case globals can't be set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Eduardo Habkost , Anthony Liguori , Igor Mammedov , Paolo Bonzini , =?us-ascii?B?PT9VVEYtOD9xP0FuZHJlYXM9MjBGPUMzPUE0cmJlcj89?= From: Eduardo Habkost It would be much better if we didn't terminate QEMU inside device_post_init(), but at least exiting cleanly is better than aborting and dumping core. Before this patch: $ qemu-system-x86_64 -global cpu.xxx=y qemu-system-x86_64: Property '.xxx' not found Aborted (core dumped) After this patch: $ qemu-system-x86_64 -global cpu.xxx=y qemu-system-x86_64: Property '.xxx' not found Reviewed-by: Michael S. Tsirkin Reviewed-By: Igor Mammedov Signed-off-by: Eduardo Habkost Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Signed-off-by: Eduardo Habkost --- hw/core/qdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3bdda8e..da1ba48 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -957,7 +957,13 @@ static void device_initfn(Object *obj) static void device_post_init(Object *obj) { - qdev_prop_set_globals(DEVICE(obj), &error_abort); + Error *err = NULL; + qdev_prop_set_globals(DEVICE(obj), &err); + if (err) { + qerror_report_err(err); + error_free(err); + exit(EXIT_FAILURE); + } } /* Unlink device from bus and free the structure. */ -- MST