summaryrefslogtreecommitdiffstats
path: root/hw/container.c
diff options
context:
space:
mode:
authorAnthony Liguori2011-12-23 15:47:39 +0100
committerAnthony Liguori2012-02-03 17:41:08 +0100
commitdb85b575b9f29487d1dd854da730a9293d91198a (patch)
treeefc2e12f5ff4816c1c104a4e7398f0e9ea3cd62c /hw/container.c
parentinfo qdm: do not require a parent_bus to be set (diff)
downloadqemu-db85b575b9f29487d1dd854da730a9293d91198a.tar.gz
qemu-db85b575b9f29487d1dd854da730a9293d91198a.tar.xz
qemu-db85b575b9f29487d1dd854da730a9293d91198a.zip
object: sure up reference counting
Now we have the following behavior: 1) object_new() returns an object with ref = 1 2) object_initialize() does not increase the reference count (ref may be 0). 3) object_deref() will finalize the object when ref = 0. it does not free the memory associated with the object. 4) both link and child properties correctly set the reference count. The expected usage is the following: 1) child devices should generally be created via object_initialize() using memory from the parent device. Adding the object as a child property will take ownership of the object and tie the child's life cycle to the parent. 2) If a child device is created via qdev_create() or some other form of object_new(), there must be an object_delete() call in the parent device's finalize function. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/container.c')
0 files changed, 0 insertions, 0 deletions