qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v4 03/23] qdev: Drop ID matching from qtree paths


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH v4 03/23] qdev: Drop ID matching from qtree paths
Date: Wed, 16 Jun 2010 00:38:27 +0200

From: Jan Kiszka <address@hidden>

Device IDs may conflict with device names or aliases. From now on we
only accept them outside qtree paths. This also makes dumping IDs in
qbus_list_dev/bus obsolete.

Signed-off-by: Jan Kiszka <address@hidden>
---
 hw/qdev.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index c272c51..aa25155 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -497,8 +497,7 @@ static void qbus_list_bus(DeviceState *dev)
     BusState *child;
     const char *sep = " ";
 
-    error_printf("child busses at \"%s\":",
-                 dev->id ? dev->id : dev->info->name);
+    error_printf("child busses at \"%s\":", dev->info->name);
     QLIST_FOREACH(child, &dev->child_bus, sibling) {
         error_printf("%s\"%s\"", sep, child->name);
         sep = ", ";
@@ -514,8 +513,6 @@ static void qbus_list_dev(BusState *bus)
     error_printf("devices at \"%s\":", bus->name);
     QLIST_FOREACH(dev, &bus->children, sibling) {
         error_printf("%s\"%s\"", sep, dev->info->name);
-        if (dev->id)
-            error_printf("/\"%s\"", dev->id);
         sep = ", ";
     }
     error_printf("\n");
@@ -539,15 +536,10 @@ static DeviceState *qbus_find_dev(BusState *bus, char 
*elem)
 
     /*
      * try to match in order:
-     *   (1) instance id, if present
-     *   (2) driver name
-     *   (3) driver alias, if present
+     *   (1) driver name
+     *   (2) driver alias, if present
      */
-    QLIST_FOREACH(dev, &bus->children, sibling) {
-        if (dev->id  &&  strcmp(dev->id, elem) == 0) {
-            return dev;
-        }
-    }
+
     QLIST_FOREACH(dev, &bus->children, sibling) {
         if (strcmp(dev->info->name, elem) == 0) {
             return dev;
-- 
1.6.0.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]