Received: from eggs.gnu.org ([2001:4830:134:3::10]:49699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cag-00038h-SF for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:43:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9cac-0005hX-L4 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:43:46 -0500 Received: from e06smtp06.uk.ibm.com ([195.75.94.102]:53915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cac-0005hQ-BD for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:43:42 -0500 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Dec 2015 17:43:40 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 18812219004D for ; Thu, 17 Dec 2015 17:43:29 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tBHHhbq09896242 for ; Thu, 17 Dec 2015 17:43:37 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tBHHha6A027734 for ; Thu, 17 Dec 2015 10:43:37 -0700 From: Cornelia Huck Date: Thu, 17 Dec 2015 18:43:32 +0100 Message-Id: <1450374212-9841-7-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1450374212-9841-1-git-send-email-cornelia.huck@de.ibm.com> References: <1450374212-9841-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 6/6] s390x/virtio: use qemu_check_nic_model() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, 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.6.4