From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtzCF-0005te-HK for qemu-devel@nongnu.org; Mon, 09 Jun 2014 09:01:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtzC9-0004tb-6L for qemu-devel@nongnu.org; Mon, 09 Jun 2014 09:01:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtzC8-0004tG-LN for qemu-devel@nongnu.org; Mon, 09 Jun 2014 09:01:00 -0400 Date: Mon, 9 Jun 2014 15:00:53 +0200 From: Igor Mammedov Message-ID: <20140609150053.7c51b119@thinkpad> In-Reply-To: <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> <20140607012615.GL15000@otherpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [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: Eduardo Habkost Cc: Peter Maydell , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Don Slutz , Markus Armbruster , Paolo Bonzini , Andreas =?ISO-8859-1?B?RuRyYmVy?= On Fri, 6 Jun 2014 22:26:15 -0300 Eduardo Habkost wrote: > 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 > > Reviewed-By: Igor Mammedov -- Regards, Igor