Received: from eggs.gnu.org ([208.118.235.92]:37997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgcV1-0001iR-2f for qemu-devel@nongnu.org; Mon, 18 Jun 2012 10:00:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgcUe-0003Yo-9m for qemu-devel@nongnu.org; Mon, 18 Jun 2012 10:00:10 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53275 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgcUe-0003YZ-0E for qemu-devel@nongnu.org; Mon, 18 Jun 2012 09:59:48 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 18 Jun 2012 15:59:10 +0200 Message-Id: <1340027954-19045-19-git-send-email-afaerber@suse.de> In-Reply-To: <1340027954-19045-1-git-send-email-afaerber@suse.de> References: <1340027954-19045-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 18/22] qdev: Connect busses with their parent devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori From: Anthony Liguori 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=C3=A4rber --- hw/qdev.c | 4 ++++ hw/sysbus.c | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) 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, con= st 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 !=3D sysbus_get_default()) { /* TODO: once all bus devices are qdevified, only reset handler for main_system_bus should be registered h= ere. */ @@ -656,6 +657,9 @@ static void device_initfn(Object *obj) class =3D object_class_get_parent(class); } while (class !=3D 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); } =20 /* Unlink device from bus and free the structure. */ diff --git a/hw/sysbus.c b/hw/sysbus.c index 2347f51..9d8b1ea 100644 --- a/hw/sysbus.c +++ b/hw/sysbus.c @@ -275,6 +275,9 @@ static void main_system_bus_create(void) qbus_create_inplace(main_system_bus, TYPE_SYSTEM_BUS, NULL, "main-system-bus"); main_system_bus->glib_allocated =3D true; + object_property_add_child(container_get(qdev_get_machine(), + "/unattached"), + "sysbus", OBJECT(main_system_bus), NULL); } =20 BusState *sysbus_get_default(void) --=20 1.7.7