From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHAkj-0004et-VG for qemu-devel@nongnu.org; Thu, 07 Jan 2016 08:37:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHAkf-0001SB-TK for qemu-devel@nongnu.org; Thu, 07 Jan 2016 08:37:21 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:47979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHAkf-0001RH-Jf for qemu-devel@nongnu.org; Thu, 07 Jan 2016 08:37:17 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Jan 2016 13:37:16 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2899B2190066 for ; Thu, 7 Jan 2016 13:37:04 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u07DbE3S7143754 for ; Thu, 7 Jan 2016 13:37:14 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u07DbEXv026673 for ; Thu, 7 Jan 2016 06:37:14 -0700 From: Cornelia Huck Date: Thu, 7 Jan 2016 14:36:55 +0100 Message-Id: <1452173818-13661-7-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1452173818-13661-1-git-send-email-cornelia.huck@de.ibm.com> References: <1452173818-13661-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH v2 6/9] 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