qdev: simplify (de)allocation of buses

All conditional deallocation can now be done with object_delete.
Remove the @qom_allocated and @glib_allocated fields; replace the latter
with a direct assignment of the @free function pointer.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Paolo Bonzini 2012-11-23 09:47:15 +01:00 committed by Anthony Liguori
parent fde9bf4470
commit 64b625f4b2
4 changed files with 3 additions and 16 deletions

View file

@ -106,17 +106,12 @@ typedef struct BusChild {
/**
* BusState:
* @qom_allocated: Indicates whether the object was allocated by QOM.
* @glib_allocated: Indicates whether the object was initialized in-place
* yet is expected to be freed with g_free().
*/
struct BusState {
Object obj;
DeviceState *parent;
const char *name;
int allow_hotplug;
bool qom_allocated;
bool glib_allocated;
int max_index;
QTAILQ_HEAD(ChildrenHead, BusChild) children;
QLIST_ENTRY(BusState) sibling;