From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsp5v-00013Z-KM for qemu-devel@nongnu.org; Fri, 06 Jun 2014 04:01:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsp5p-0005Va-GP for qemu-devel@nongnu.org; Fri, 06 Jun 2014 04:01:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsp5p-0005VJ-7I for qemu-devel@nongnu.org; Fri, 06 Jun 2014 04:01:41 -0400 Message-ID: <5391755E.9070507@redhat.com> Date: Fri, 06 Jun 2014 10:01:34 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1399312987-29499-1-git-send-email-dslutz@verizon.com> <1399312987-29499-2-git-send-email-dslutz@verizon.com> <87wqcuzf8z.fsf_-_@blackfin.pond.sub.org> In-Reply-To: <87wqcuzf8z.fsf_-_@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Should not abort on -global List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Eduardo Habkost Cc: "Michael S. Tsirkin" , qemu-devel@nongnu.org, Don Slutz , =?ISO-8859-15?Q?Andreas_F=E4rber?= Il 06/06/2014 09:09, Markus Armbruster ha scritto: > Looks like this regressed in Eduardo's commit 99a0b03 qdev: Set globals > in instance_post_init function. > > Before, we exited cleanly on this error, in device_initfn(): > > qdev_prop_set_globals(dev, &err); > if (err != NULL) { > qerror_report_err(err); > error_free(err); > exit(1); > } Hmm, right. I had noticed this abort in the past, but I wasn't sure if it was a regression or not. However, the above is not hotplug-friendly either. In this sense, I prefer an assertion that clearly says "gotta fix something here". > The commit asserts qdev_prop_set_globals() can't fail, which is wrong. > > static void device_post_init(Object *obj) > { > DeviceState *dev = DEVICE(obj); > Error *err = NULL; > > qdev_prop_set_globals(dev, &err); > assert_no_error(err); > } > > Later simplified to: > > static void device_post_init(Object *obj) > { > qdev_prop_set_globals(DEVICE(obj), &error_abort); > } I think the bug is that the global property should have been filtered out early. Or alternatively we need something better than device_post_init to set the globals... no ideas for now. Paolo