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

Nutty Liu liujingqi at lanxincomputing.com
Mon Jul 7 20:41:18 PDT 2025


On 7/4/2025 11:12 PM, Andrew Jones wrote:
> 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>
Reviewed-by: Nutty Liu <liujingqi at lanxincomputing.com>

Thanks,
Nutty
> ---
>   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 $?



More information about the kvm-riscv mailing list