From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJMw9-0002OX-0N for qemu-devel@nongnu.org; Wed, 13 Jan 2016 10:02:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJMvo-0006C8-99 for qemu-devel@nongnu.org; Wed, 13 Jan 2016 10:02:12 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:45162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJMvn-0006Bt-V2 for qemu-devel@nongnu.org; Wed, 13 Jan 2016 10:01:52 -0500 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jan 2016 15:01:51 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 944BB2190056 for ; Wed, 13 Jan 2016 15:01:38 +0000 (GMT) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0DF1n9Z55443664 for ; Wed, 13 Jan 2016 15:01:49 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0DF1m8e011730 for ; Wed, 13 Jan 2016 08:01:49 -0700 From: Cornelia Huck Date: Wed, 13 Jan 2016 16:01:41 +0100 Message-Id: <1452697304-29695-7-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1452697304-29695-1-git-send-email-cornelia.huck@de.ibm.com> References: <1452697304-29695-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL 6/9] s390x/virtio: use qemu_check_nic_model() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, qemu-devel@nongnu.org, agraf@suse.de Switching to the generally used interface changes the output of s390x-softmmu/qemu-system-s390x -net nic,model=? from S390 only supports VirtIO nics to the rather more useful qemu: Supported NIC models: virtio while still giving us a sensible error message for unsupported models: s390x-softmmu/qemu-system-s390x -net nic,model=foo qemu-system-s390x: Unsupported NIC model: foo Acked-by: David Hildenbrand Acked-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c index 5dbb815..946325f 100644 --- a/hw/s390x/s390-virtio.c +++ b/hw/s390x/s390-virtio.c @@ -131,10 +131,7 @@ void s390_create_virtio_net(BusState *bus, const char *name) nd->model = g_strdup("virtio"); } - if (strcmp(nd->model, "virtio")) { - fprintf(stderr, "S390 only supports VirtIO nics\n"); - exit(1); - } + qemu_check_nic_model(nd, "virtio"); dev = qdev_create(bus, name); qdev_set_nic_properties(dev, nd); -- 2.7.0