Re: [libvirt] [PATCH v2] qemu: Use virtio network device for aarch64/virt
On 02/14/2014 09:09 AM, Oleg Strikov wrote: 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.stri...@canonical.com --- Changes since v1: * qemuxml2argvtest suite has been extended to validate correct setup for aarch64 guests when no NIC model is provided in the XML ACK, pushed now. - Cole 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 000..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 000..868de94 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml @@ -0,0 +1,22 @@ +domain type=qemu + nameaarch64-virt-default-nic/name + uuid6ba410c5-1e5c-4d57-bee7-2228e7ffa32f/uuid + memory1048576/memory + currentMemory1048576/currentMemory + vcpu1/vcpu + features +acpi/ + /features + os +type arch=aarch64 machine=virthvm/type +kernel/aarch64.kernel/kernel +initrd/aarch64.initrd/initrd +cmdlineconsole=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); -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH v2] 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.stri...@canonical.com --- 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 000..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 000..868de94 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml @@ -0,0 +1,22 @@ +domain type=qemu + nameaarch64-virt-default-nic/name + uuid6ba410c5-1e5c-4d57-bee7-2228e7ffa32f/uuid + memory1048576/memory + currentMemory1048576/currentMemory + vcpu1/vcpu + features +acpi/ + /features + os +type arch=aarch64 machine=virthvm/type +kernel/aarch64.kernel/kernel +initrd/aarch64.initrd/initrd +cmdlineconsole=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@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH v2] 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.stri...@canonical.com --- 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 c947e2e..a0e9a33 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -795,11 +795,12 @@ qemuDomainDefaultNetModel(const virDomainDef *def) { if (def-os.arch == VIR_ARCH_S390 || 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; if (STREQ(def-os.machine, virt)) return virtio; 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 000..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 000..868de94 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml @@ -0,0 +1,22 @@ +domain type=qemu + nameaarch64-virt-default-nic/name + uuid6ba410c5-1e5c-4d57-bee7-2228e7ffa32f/uuid + memory1048576/memory + currentMemory1048576/currentMemory + vcpu1/vcpu + features +acpi/ + /features + os +type arch=aarch64 machine=virthvm/type +kernel/aarch64.kernel/kernel +initrd/aarch64.initrd/initrd +cmdlineconsole=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 a25264e..1a18ee2 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1316,10 +1316,13 @@ mymain(void) DO_TEST(aarch64-virt-virtio, 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); DO_TEST(kvm-pit-device, QEMU_CAPS_NO_KVM_PIT, QEMU_CAPS_KVM_PIT_TICK_POLICY); -- 1.7.9.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list