diff mbox

Add support for virt machine with virtio-mmio devices

Message ID 1384228742-18061-1-git-send-email-clark.laughlin@linaro.org
State Superseded
Headers show

Commit Message

Clark Laughlin Nov. 12, 2013, 3:59 a.m. UTC
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 mbox

Patch

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";