diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2014-03-19 21:45:41 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2014-03-19 21:45:42 +0000 |
| commit | 037b7addb7f9ad5dc52c3d05da8b2f60386252ff (patch) | |
| tree | 2eccb0dca91eb017d45abdf184a562b09f980940 /hw/core/qdev.c | |
| parent | f71e769d0754dc9a593a9e17ec6693a261b29f82 (diff) | |
| parent | abdffd1fb78c1b98bda925d3d59123beca6761a3 (diff) | |
| download | focaccia-qemu-037b7addb7f9ad5dc52c3d05da8b2f60386252ff.tar.gz focaccia-qemu-037b7addb7f9ad5dc52c3d05da8b2f60386252ff.zip | |
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-2.0' into staging
QOM/QTest infrastructure fixes * QOM machine memory and build fixes * QOM link<> and child<> property reference counting fixes # gpg: Signature made Wed 19 Mar 2014 21:44:04 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-2.0: virtio-rng: Avoid default_backend refcount leak qom: Add check() argument to object_property_add_link() qom: Make QOM link property unref optional qom: Don't make link NULL on object_property_set_link() failure qom: Split object_property_set_link() vl.c: Fix OpenBSD compilation issue due to namespace collisions vl.c: Fix memory leak in qemu_register_machine() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/qdev.c')
| -rw-r--r-- | hw/core/qdev.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 9f0a522ee8..97acf62906 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -98,6 +98,8 @@ static void bus_add_child(BusState *bus, DeviceState *child) object_property_add_link(OBJECT(bus), name, object_get_typename(OBJECT(child)), (Object **)&kid->child, + NULL, /* read-only property */ + 0, /* return ownership on prop deletion */ NULL); } @@ -824,7 +826,8 @@ static void device_initfn(Object *obj) } while (class != object_class_by_name(TYPE_DEVICE)); object_property_add_link(OBJECT(dev), "parent_bus", TYPE_BUS, - (Object **)&dev->parent_bus, &error_abort); + (Object **)&dev->parent_bus, NULL, 0, + &error_abort); } static void device_post_init(Object *obj) @@ -944,7 +947,10 @@ static void qbus_initfn(Object *obj) QTAILQ_INIT(&bus->children); object_property_add_link(obj, QDEV_HOTPLUG_HANDLER_PROPERTY, TYPE_HOTPLUG_HANDLER, - (Object **)&bus->hotplug_handler, NULL); + (Object **)&bus->hotplug_handler, + object_property_allow_set_link, + OBJ_PROP_LINK_UNREF_ON_RELEASE, + NULL); object_property_add_bool(obj, "realized", bus_get_realized, bus_set_realized, NULL); } |