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

[libvirt] [PATCH 1/3] 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.
---
I assigned the authorship to Viktor as I just took his suggested patch from the
mail thread regarding the close callback.

 src/qemu/qemu_domain.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f431aec..9dedd4a 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)
 {
@@ -688,9 +688,15 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,

     if (dev->type == VIR_DOMAIN_DEVICE_NET &&
         dev->data.net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV) {
+        const char *model = NULL;
+        if (def->os.arch == VIR_ARCH_S390 ||
+            def->os.arch == VIR_ARCH_S390X)
+            model = "virtio";
+        else
+            model = "rtl8139";
         if (!dev->data.net->model &&
-            !(dev->data.net->model = strdup("rtl8139")))
-                goto no_memory;
+            !(dev->data.net->model = strdup(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]