[PATCH] Add support for virt machine with virtio-mmio devices

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

 



These changes allow the correct virtio-blk-device and virtio-net-device
devices to be used for the 'virt' machine type rather than the PCI virtio
devices.
---
 src/qemu/qemu_command.c | 4 +++-
 src/qemu/qemu_domain.c  | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 63e235d..901120e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1335,12 +1335,14 @@ cleanup:
 
     return ret;
 }
+
 static int
 qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
                                        virQEMUCapsPtr qemuCaps)
 {
     if (def->os.arch == VIR_ARCH_ARMV7L &&
-        STRPREFIX(def->os.machine, "vexpress-") &&
+        (STRPREFIX(def->os.machine, "vexpress-") ||
+            STREQ(def->os.machine, "virt")) &&
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
         qemuDomainPrimeVirtioDeviceAddresses(
             def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 81d0ba9..346fec3 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -797,6 +797,9 @@ qemuDomainDefaultNetModel(const virDomainDef *def)
         if (STREQ(def->os.machine, "versatilepb"))
             return "smc91c111";
 
+        if (STREQ(def->os.machine, "virt"))
+            return "virtio";
+
         /* Incomplete. vexpress (and a few others) use this, but not all
          * arm boards */
         return "lan9118";
-- 
1.8.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]