On 11/15/2013 02:53 PM, Clark Laughlin wrote:
These changes allow the correct virtio-blk-device and
virtio-net-device
devices to be used for the 'virt' machine type for armv7 rather than the
PCI virtio devices.
Hi Clark,
Patch looks fine, but can you include a test case with it? Something like
tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.xml and the
associated *.args file, but using the 'virt' machine type. See the HACKING
file for tips on working with the test suite.
Then CC me on the next patch and I'll review and apply.
Thanks,
Cole
Signed-off-by: Clark Laughlin <clark.laughlin(a)linaro.org>
---
Resend, with signed-off-by added and updated subject.
---
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";