[Top][All Lists]

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

[Qemu-devel] [PATCH] Fix legacy device aliases for s390

From: Christian Borntraeger
Subject: [Qemu-devel] [PATCH] Fix legacy device aliases for s390
Date: Thu, 3 May 2012 10:47:16 +0200

When qemu is called with -device virtio-serial/blk/net on s390, this alias
is translated to virtio-serial/blk/net-pci instead of s390, since these
drivers are first in the alias table.
Let the core code check if the driver exist, if not lets search further.
This fixes errors like:

qemu-kvm: -device virtio-serial,id=virtio-serial0: Parameter 'driver'
expects device type

Signed-off-by: Christian Borntraeger <address@hidden>
 hw/qdev-monitor.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index dc4e4e1..8d1b5ba 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -110,7 +110,8 @@ static const char *find_typename_by_alias(const char *alias)
     int i;
     for (i = 0; qdev_alias_table[i].alias; i++) {
-        if (strcmp(qdev_alias_table[i].alias, alias) == 0) {
+        if (strcmp(qdev_alias_table[i].alias, alias) == 0 &&
+            object_class_by_name(qdev_alias_table[i].typename)) {
             return qdev_alias_table[i].typename;

reply via email to

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