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

[libvirt] [PATCHv2] qemu: Use correct default model on s390



From: Viktor Mihajlovski <mihajlov linux vnet ibm com>

Commit a68d6726679323823ee5be47f0144e9ccffa0757 breaks networking on s390 as it
changes the default network card model.
---
 src/qemu/qemu_domain.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f431aec..6ed2b40 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -678,7 +678,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,

 static int
 qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
-                             virDomainDefPtr def ATTRIBUTE_UNUSED,
+                             virDomainDefPtr def,
                              virCapsPtr caps ATTRIBUTE_UNUSED,
                              void *opaque)
 {
@@ -687,10 +687,16 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
     virQEMUDriverConfigPtr cfg = NULL;

     if (dev->type == VIR_DOMAIN_DEVICE_NET &&
-        dev->data.net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV) {
-        if (!dev->data.net->model &&
-            !(dev->data.net->model = strdup("rtl8139")))
-                goto no_memory;
+        dev->data.net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&
+        !dev->data.net->model) {
+        if (def->os.arch == VIR_ARCH_S390 ||
+            def->os.arch == VIR_ARCH_S390X)
+            dev->data.net->model = strdup("virtio");
+        else
+            dev->data.net->model = strdup("rtl8139");
+
+        if (!dev->data.net->model)
+            goto no_memory;
     }

     /* set default disk types and drivers */
-- 
1.8.1.5


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