]> git.proxmox.com Git - qemu.git/commitdiff
qbus: remove wrong error messages
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 17 Apr 2013 07:49:00 +0000 (17:49 +1000)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 17 Apr 2013 15:24:11 +0000 (10:24 -0500)
The existing code shows the "Bus '%s' is full" message even if name
is specified and different from bus->name (i.e. match=0).

The patch excludes unnecessary error message.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1366184940-13516-1-git-send-email-aik@ozlabs.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev-monitor.c

index 73d79461db3bf2eb5e97dc18e5596fc8a32c3ba5..2cb5600d635402aeee9d60313ea8ad2c341d0cb6 100644 (file)
@@ -292,11 +292,9 @@ static BusState *qbus_find_recursive(BusState *bus, const char *name,
 
     if (name && (strcmp(bus->name, name) != 0)) {
         match = 0;
-    }
-    if (bus_typename && !object_dynamic_cast(OBJECT(bus), bus_typename)) {
+    } else if (bus_typename && !object_dynamic_cast(OBJECT(bus), bus_typename)) {
         match = 0;
-    }
-    if ((bus_class->max_dev != 0) && (bus_class->max_dev <= bus->max_index)) {
+    } else if ((bus_class->max_dev != 0) && (bus_class->max_dev <= bus->max_index)) {
         if (name != NULL) {
             /* bus was explicitly specified: return an error. */
             qerror_report(ERROR_CLASS_GENERIC_ERROR, "Bus '%s' is full",