mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
qdev: move bus removal to object_unparent
Add an ObjectClass method that is done at object_unparent time. It should remove any backlinks to the object in the composition tree, so that object_delete will be able to drop the last reference and free the object. Use it for qdev buses. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
764b63125a
commit
667d22d1ae
3 changed files with 27 additions and 3 deletions
|
@ -229,6 +229,15 @@ typedef struct ObjectProperty
|
|||
QTAILQ_ENTRY(ObjectProperty) node;
|
||||
} ObjectProperty;
|
||||
|
||||
/**
|
||||
* ObjectUnparent:
|
||||
* @obj: the object that is being removed from the composition tree
|
||||
*
|
||||
* Called when an object is being removed from the QOM composition tree.
|
||||
* The function should remove any backlinks from children objects to @obj.
|
||||
*/
|
||||
typedef void (ObjectUnparent)(Object *obj);
|
||||
|
||||
/**
|
||||
* ObjectClass:
|
||||
*
|
||||
|
@ -240,6 +249,8 @@ struct ObjectClass
|
|||
/*< private >*/
|
||||
Type type;
|
||||
GSList *interfaces;
|
||||
|
||||
ObjectUnparent *unparent;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue