This patch changes network device type used by default from rtl8139 to virtio when architecture type is aarch64 and machine type is virt. Qemu doesn't support any other machine types for aarch64 right now and we can't make any other aarch64-specific tuning in this function yet. Signed-off-by: Oleg Strikov <oleg.strikov@xxxxxxxxxxxxx> --- Changes since v1: * qemuxml2argvtest suite has been extended to validate correct setup for aarch64 guests when no NIC model is provided in the XML src/qemu/qemu_domain.c | 3 ++- .../qemuxml2argv-aarch64-virt-default-nic.args | 6 ++++++ .../qemuxml2argv-aarch64-virt-default-nic.xml | 22 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 3 +++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a665061..9a040ee 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -797,7 +797,8 @@ qemuDomainDefaultNetModel(const virDomainDef *def) def->os.arch == VIR_ARCH_S390X) return "virtio"; - if (def->os.arch == VIR_ARCH_ARMV7L) { + if (def->os.arch == VIR_ARCH_ARMV7L || + def->os.arch == VIR_ARCH_AARCH64) { if (STREQ(def->os.machine, "versatilepb")) return "smc91c111"; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args new file mode 100644 index 0000000..d4d403b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args @@ -0,0 +1,6 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 -S -M virt -m 1024 -smp 1 -nographic \ +-nodefconfig -nodefaults -monitor unix:/tmp/test-monitor,server,nowait \ +-boot c -kernel /aarch64.kernel -initrd /aarch64.initrd -append console=ttyAMA0 \ +-usb -device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \ +-net user,vlan=0,name=hostnet0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml new file mode 100644 index 0000000..868de94 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml @@ -0,0 +1,22 @@ +<domain type="qemu"> + <name>aarch64-virt-default-nic</name> + <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid> + <memory>1048576</memory> + <currentMemory>1048576</currentMemory> + <vcpu>1</vcpu> + <features> + <acpi/> + </features> + <os> + <type arch="aarch64" machine="virt">hvm</type> + <kernel>/aarch64.kernel</kernel> + <initrd>/aarch64.initrd</initrd> + <cmdline>console=ttyAMA0</cmdline> + </os> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7a5b50d..43ac1d1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1335,6 +1335,9 @@ mymain(void) QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); + DO_TEST("aarch64-virt-default-nic", + QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_VIRTIO_MMIO); DO_TEST("kvm-pit-device", QEMU_CAPS_KVM_PIT_TICK_POLICY); DO_TEST("kvm-pit-delay", QEMU_CAPS_NO_KVM_PIT); -- 1.7.9.5 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list