qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 6/9] s390x/virtio: use qemu_check_nic_model()


From: Cornelia Huck
Subject: [Qemu-devel] [PATCH v2 6/9] s390x/virtio: use qemu_check_nic_model()
Date: Thu, 7 Jan 2016 14:36:55 +0100

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 <address@hidden>
Acked-by: Christian Borntraeger <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]