summary refs log tree commit diff stats
path: root/hw/qdev.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-09-16 22:25:27 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:45 -0500
commitcd739fb6e93c32154c898c822c967877894b1ab3 (patch)
tree8ba2c08b8809bc524d04798fa71532e37342a471 /hw/qdev.c
parent828566bc3314f91575a8a814f6ff21efc7005b14 (diff)
downloadfocaccia-qemu-cd739fb6e93c32154c898c822c967877894b1ab3.tar.gz
focaccia-qemu-cd739fb6e93c32154c898c822c967877894b1ab3.zip
allow qdev busses allocations be inplace
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index a589d72406..530e674045 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -502,13 +502,12 @@ static BusState *qbus_find(const char *path)
     }
 }
 
-BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)
+void qbus_create_inplace(BusState *bus, BusInfo *info,
+                         DeviceState *parent, const char *name)
 {
-    BusState *bus;
     char *buf;
     int i,len;
 
-    bus = qemu_mallocz(info->size);
     bus->info = info;
     bus->parent = parent;
 
@@ -537,6 +536,16 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)
         QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
         parent->num_child_bus++;
     }
+
+}
+
+BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)
+{
+    BusState *bus;
+
+    bus = qemu_mallocz(info->size);
+    bus->qdev_allocated = 1;
+    qbus_create_inplace(bus, info, parent, name);
     return bus;
 }