qemu: Use virtio network device for aarch64/virt

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@canonical.com>
This commit is contained in:
Oleg Strikov 2014-02-14 18:09:00 +04:00 committed by Cole Robinson
parent 0eb4a5f4f1
commit 41b9b71877
4 changed files with 33 additions and 1 deletions

View File

@ -818,7 +818,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";

View File

@ -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

View File

@ -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>

View File

@ -1338,6 +1338,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);