[kvm-unit-tests PATCH 2/2] arm/run: Fix using qemu-system-aarch64 to run aarch32 tests on aarch64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrew Jones <drjones@xxxxxxxxxx>

KVM on arm64 can create 32 bit and 64 bit VMs. kvm-unit-tests tries to
take advantage of this by setting the aarch64=off -cpu option. However,
get_qemu_accelerator() isn't aware that KVM on arm64 can run both types
of VMs and it selects qemu-system-arm instead of qemu-system-aarch64.
This leads to an error in premature_failure() and the test is marked as
skipped:

$ ./run_tests.sh selftest-setup
SKIP selftest-setup (qemu-system-arm: -accel kvm: invalid accelerator kvm)

Fix this by setting QEMU to the correct qemu binary before calling
get_qemu_accelerator().

Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
[ Alex E: Added commit message, changed the logic to make it clearer ]
Signed-off-by: Alexandru Elisei <alexandru.elisei@xxxxxxx>
---
 arm/run | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arm/run b/arm/run
index 2153bd320751..5fe0a45c4820 100755
--- a/arm/run
+++ b/arm/run
@@ -13,6 +13,11 @@ processor="$PROCESSOR"
 ACCEL=$(get_qemu_accelerator) ||
 	exit $?
 
+# KVM for arm64 can create a VM in either aarch32 or aarch64 modes.
+if [ "$ACCEL" = kvm ] && [ -z "$QEMU" ] && [ "$HOST" = "aarch64" ]; then
+	QEMU=qemu-system-aarch64
+fi
+
 qemu=$(search_qemu_binary) ||
 	exit $?
 
-- 
2.35.1

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux