From f968fc6892daf02865cce8af277cc755be690eda Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Wed, 2 May 2012 10:39:01 +0200 Subject: qdev: Connect busses with their parent devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes SysBus part of the root hierarchy and all busses children of their respective parent DeviceState. Signed-off-by: Anthony Liguori Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- hw/qdev.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw/qdev.c') diff --git a/hw/qdev.c b/hw/qdev.c index 63012b5..dc46e7b 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -404,6 +404,7 @@ static void do_qbus_create_inplace(BusState *bus, const char *typename, if (parent) { QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling); parent->num_child_bus++; + object_property_add_child(OBJECT(parent), bus->name, OBJECT(bus), NULL); } else if (bus != sysbus_get_default()) { /* TODO: once all bus devices are qdevified, only reset handler for main_system_bus should be registered here. */ @@ -656,6 +657,9 @@ static void device_initfn(Object *obj) class = object_class_get_parent(class); } while (class != object_class_by_name(TYPE_DEVICE)); qdev_prop_set_globals(dev); + + object_property_add_link(OBJECT(dev), "parent_bus", TYPE_BUS, + (Object **)&dev->parent_bus, NULL); } /* Unlink device from bus and free the structure. */ -- cgit v1.1