From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdLeb-00076u-M7 for qemu-devel@nongnu.org; Wed, 11 Jul 2018 16:24:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdLea-0005x9-UE for qemu-devel@nongnu.org; Wed, 11 Jul 2018 16:24:01 -0400 Date: Wed, 11 Jul 2018 17:23:51 -0300 From: Eduardo Habkost Message-ID: <20180711202351.GA31657@localhost.localdomain> References: <1531170180-21199-1-git-send-email-thuth@redhat.com> <20180711183031.GM914@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] hw/arm/bcm283x: Fix crash with device_add bcm2837 on unsupported machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Thomas Huth , qemu-devel@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, Markus Armbruster On Wed, Jul 11, 2018 at 10:16:42PM +0200, Paolo Bonzini wrote: > On 11/07/2018 20:30, Eduardo Habkost wrote: > >> The theoretical behavior should be: > > It's not clear below where you expect > > qdev_set_parent_bus(..., sysbus_get_default()) > > to be called (if it should be called at all). > > > > I don't know where it should be called, but I'm absolutely sure > > instance_init is not the right place. > > I think instance_init is fine to call qdev_set_parent_bus on contained > devices. Why do you say it's not? Because object_unref(object_new(...)) is not supposed to affect QEMU global state at all. -- Eduardo