[kvm-unit-tests PATCH 1/2] arm/arm64: Ensure proper host arch with kvmtool

Andrew Jones andrew.jones at linux.dev
Fri Jul 4 08:12:56 PDT 2025


When running on non-arm (e.g. an x86 machine) if the framework is
configured to use kvmtool then, unlike with QEMU, it can't work.

Signed-off-by: Andrew Jones <andrew.jones at linux.dev>
---
 arm/run | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arm/run b/arm/run
index 9ee795ae424c..858333fce465 100755
--- a/arm/run
+++ b/arm/run
@@ -97,6 +97,11 @@ function arch_run_kvmtool()
 {
 	local command
 
+	if [ "$HOST" != "arm" ] && [ "$HOST" != "aarch64" ]; then
+		echo "kvmtool requires KVM but the host ('$HOST') is not arm" >&2
+		exit 2
+	fi
+
 	kvmtool=$(search_kvmtool_binary) ||
 		exit $?
 
-- 
2.49.0




More information about the kvm-riscv mailing list