From 0866aca1de15a12547f52ff8563cf7c163e1898e Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 23 Dec 2011 15:34:39 -0600 Subject: qbus: Make child devices links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make qbus children show up as link<> properties. There is no stable addressing for qbus children so we use an unstable naming convention. This is okay in QOM though because the composition name is expected to be what's stable. Signed-off-by: Anthony Liguori Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- hw/qdev.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'hw/qdev.h') diff --git a/hw/qdev.h b/hw/qdev.h index 736271ecef..e39f82e029 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -74,7 +74,6 @@ struct DeviceState { qemu_irq *gpio_in; QLIST_HEAD(, BusState) child_bus; int num_child_bus; - QTAILQ_ENTRY(DeviceState) sibling; int instance_id_alias; int alias_required_for_version; }; @@ -100,6 +99,12 @@ struct BusClass { int (*reset)(BusState *bus); }; +typedef struct BusChild { + DeviceState *child; + int index; + QTAILQ_ENTRY(BusChild) sibling; +} BusChild; + /** * BusState: * @qom_allocated: Indicates whether the object was allocated by QOM. @@ -113,7 +118,8 @@ struct BusState { int allow_hotplug; bool qom_allocated; bool glib_allocated; - QTAILQ_HEAD(ChildrenHead, DeviceState) children; + int max_index; + QTAILQ_HEAD(ChildrenHead, BusChild) children; QLIST_ENTRY(BusState) sibling; }; -- cgit v1.2.3