qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix legacy device aliases for s390
@ 2012-05-03  8:47 Christian Borntraeger
  2012-05-03  8:49 ` Alexander Graf
  0 siblings, 1 reply; 12+ messages in thread
From: Christian Borntraeger @ 2012-05-03  8:47 UTC (permalink / raw)
  To: aliguori, pbonzini; +Cc: Christian Borntraeger, agraf, qemu-devel

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 <borntraeger@de.ibm.com>
---
 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;
         }
     }
-- 
1.7.9.6

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-05-18  0:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-03  8:47 [Qemu-devel] [PATCH] Fix legacy device aliases for s390 Christian Borntraeger
2012-05-03  8:49 ` Alexander Graf
2012-05-03  8:53   ` Christian Borntraeger
2012-05-03  8:55     ` Alexander Graf
2012-05-03  9:03   ` Paolo Bonzini
2012-05-03  9:05     ` Paolo Bonzini
2012-05-03  9:07       ` Alexander Graf
2012-05-03  9:16         ` Paolo Bonzini
2012-05-03 12:32         ` Anthony Liguori
2012-05-03 13:34           ` Alexander Graf
2012-05-17 22:57             ` Alexander Graf
2012-05-18  0:28               ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).