Received: from eggs.gnu.org ([208.118.235.92]:44524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPrhD-00046C-Al for qemu-devel@nongnu.org; Thu, 03 May 2012 04:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPrh7-0002sM-5V for qemu-devel@nongnu.org; Thu, 03 May 2012 04:47:30 -0400 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:40219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPrh6-0002rq-TQ for qemu-devel@nongnu.org; Thu, 03 May 2012 04:47:25 -0400 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 May 2012 09:47:21 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q438lIor2400300 for ; Thu, 3 May 2012 09:47:18 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q438lIBq000656 for ; Thu, 3 May 2012 02:47:18 -0600 From: Christian Borntraeger Date: Thu, 3 May 2012 10:47:16 +0200 Message-Id: <1336034836-17892-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH] Fix legacy device aliases for s390 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com, pbonzini@redhat.com Cc: Christian Borntraeger , agraf@suse.de, qemu-devel@nongnu.org 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 --- 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