From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtae1-0005ts-7Y for qemu-devel@nongnu.org; Sun, 08 Jun 2014 06:48:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wtadv-0003dR-28 for qemu-devel@nongnu.org; Sun, 08 Jun 2014 06:48:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtadu-0003dK-KY for qemu-devel@nongnu.org; Sun, 08 Jun 2014 06:48:02 -0400 Date: Sun, 8 Jun 2014 13:48:25 +0300 From: "Michael S. Tsirkin" Message-ID: <20140608104825.GC26245@redhat.com> 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-Disposition: inline In-Reply-To: <20140607012615.GL15000@otherpad.lan.raisama.net> 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 , qemu-devel@nongnu.org, Don Slutz , Markus Armbruster , Paolo Bonzini , Igor Mammedov , Andreas =?iso-8859-1?Q?F=E4rber?= On Fri, Jun 06, 2014 at 10:26:15PM -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 Reviewed-by: Michael S. Tsirkin > --- > 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