qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 01/12] qdev: export and use qbus_init


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 01/12] qdev: export and use qbus_init
Date: Mon, 21 Jan 2013 14:01:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

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 object
> (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_realize
> and export it as qbus_init.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>

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() first?

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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]