diff mbox

[8/8] qdev: Add new devices/buses at the tail

Message ID 06ac47f0f72d5966014ec1fb436b89e5f166a89b.1273843151.git.jan.kiszka@siemens.com
State New
Headers show

Commit Message

Jan Kiszka May 14, 2010, 1:20 p.m. UTC
Cosmetic change to align the instance number assignment with bus
ordering. The current ordering is a bit annoying when you dump the qtree
or address devices via 'driver.instance'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/qdev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index c989010..3864478 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -91,7 +91,7 @@  static DeviceState *qdev_create_from_info(BusState *bus, DeviceInfo *info)
     qdev_prop_set_defaults(dev, dev->info->props);
     qdev_prop_set_defaults(dev, dev->parent_bus->info->props);
     qdev_prop_set_globals(dev);
-    QLIST_INSERT_HEAD(&bus->children, dev, sibling);
+    QLIST_INSERT_TAIL(&bus->children, dev, sibling);
     if (qdev_hotplug) {
         assert(bus->allow_hotplug);
         dev->hotplugged = 1;
@@ -677,7 +677,7 @@  void qbus_create_inplace(BusState *bus, BusInfo *info,
 
     QLIST_INIT(&bus->children);
     if (parent) {
-        QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
+        QLIST_INSERT_TAIL(&parent->child_bus, bus, sibling);
         parent->num_child_bus++;
     }