[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/12] qdev: export and use qbus_init |
Date: |
Mon, 21 Jan 2013 14:15:20 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Il 21/01/2013 14:01, Andreas Färber ha scritto:
>> > 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.
Yes, you did and I thought about it but I had no good ideas really. We
have a lot of differently named functions, but in the end "everything
before realize should be named init" sounds like the only sensible rule...
Paolo
- [Qemu-devel] [PATCH v2 00/12] qdev: correct reference counting, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 01/12] qdev: export and use qbus_init, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 02/12] qdev: use object_new, not g_malloc to create buses, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 03/12] qom: preserve object while unparenting it, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 05/12] qdev: add reference count to a device for the BusChild, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 06/12] qdev: move deletion of children from finalize to unparent, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 07/12] qdev: move unrealization of devices from finalize to unparent, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 11/12] cpu: do not use object_delete, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 09/12] qdev: inline object_delete into qbus_free/qdev_free, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 04/12] qom: document reference counting of link properties, Paolo Bonzini, 2013/01/21
- [Qemu-devel] [PATCH v2 08/12] qdev: add reference for the bus while it is referred to by the DeviceState, Paolo Bonzini, 2013/01/21