From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxH0i-0004Jx-4L for qemu-devel@nongnu.org; Mon, 21 Jan 2013 08:02:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxH0d-0006Bg-H5 for qemu-devel@nongnu.org; Mon, 21 Jan 2013 08:02:00 -0500 Received: from cantor2.suse.de ([195.135.220.15]:53453 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxH0d-0006BV-Ay for qemu-devel@nongnu.org; Mon, 21 Jan 2013 08:01:55 -0500 Message-ID: <50FD3C3F.6060001@suse.de> Date: Mon, 21 Jan 2013 14:01:51 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1358771422-14282-1-git-send-email-pbonzini@redhat.com> <1358771422-14282-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1358771422-14282-2-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 01/12] qdev: export and use qbus_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Am 21.01.2013 13:30, schrieb Paolo Bonzini: > BusState subclasses need to do their own allocation because > qbus_create_inplace calls object_initialize (which wipes out the > "free" callback). This patch separates the initialization of the objec= t > (object_initialize) from its insertion in the qdev tree (qbus_realize);= to > do so, it moves the remaining bits of qbus_create_inplace to qbus_reali= ze > and export it as qbus_init. >=20 > Signed-off-by: Paolo Bonzini I think I left some comments on v1: Would it be possible to leave a bus_initialize() function (without q ;)) in place that calls object_initialize() plus the-artist-formerly-known-as-qbus_realize(), shared between object_new() and object_initialize()? ->free was always set afterwards. The issue I am trying to contain here is a surge of *_init functions beyond class_init, instance_init, DeviceClass::init. Sticking to the QOM naming of having *bus_initialize() and *bus_new() would address that. Maybe if we reorder the two patches, dropping the use of g_malloc0() firs= t? Currently care needs to be taken with the in-place bus initialization functions to not apply PCI_BUS() etc. on the uninitialized variable. Having a pci_bus_initialize(void *, ...) -> bus_initialize(void *, ...) -> object_initialize(void *, ...) call chain would solve that. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg