Received: from eggs.gnu.org ([2001:4830:134:3::10]:32839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wt5Os-0003py-PU for qemu-devel@nongnu.org; Fri, 06 Jun 2014 21:26:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wt5Om-0003qx-Kj for qemu-devel@nongnu.org; Fri, 06 Jun 2014 21:26:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wt5Om-0003qq-DM for qemu-devel@nongnu.org; Fri, 06 Jun 2014 21:26:20 -0400 Date: Fri, 6 Jun 2014 22:26:15 -0300 From: Eduardo Habkost Message-ID: <20140607012615.GL15000@otherpad.lan.raisama.net> References: <20140606201429.GK15000@otherpad.lan.raisama.net> <20140606233858.1f126642@thinkpad> <20140606222136.GD17594@otherpad.lan.raisama.net> <20140607012209.70d48228@thinkpad> <20140607010918.GE17594@otherpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140607010918.GE17594@otherpad.lan.raisama.net> Subject: [Qemu-devel] [PATCH] 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 , "Michael S. Tsirkin" , Markus Armbruster , Don Slutz , Paolo Bonzini , Igor Mammedov , Andreas =?iso-8859-1?Q?F=E4rber?= 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. 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 e65a5aa..74862c2 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -901,7 +901,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. */ -- 1.9.0