test: set TEST_NESTED_KVM as default

This commit is contained in:
Thomas Blume
2024-10-07 11:40:17 +02:00
committed by Frantisek Sumsal
parent 12a1b02b52
commit 5540c37bb8
2 changed files with 5 additions and 11 deletions
-4
View File
@@ -202,10 +202,6 @@ systemd-nspawn.
`TEST_NO_KVM=1`: Disable qemu KVM auto-detection (may be necessary when you're
trying to run the *vanilla* qemu and have both qemu and qemu-kvm installed)
`TEST_NESTED_KVM=1`: Allow tests to run with nested KVM. By default, the
testsuite disables nested KVM if the host machine already runs under KVM.
Setting this variable disables such checks.
`QEMU_MEM=512M`: Configure amount of memory for qemu VMs (defaults to 512M).
`QEMU_SMP=1`: Configure number of CPUs for qemu VMs (defaults to 1).
+5 -7
View File
@@ -84,14 +84,12 @@ add_at_exit_handler() {
}
# Decide if we can (and want to) run qemu with KVM acceleration.
# Check if nested KVM is explicitly enabled (TEST_NESTED_KVM). If not,
# check if it's not explicitly disabled (TEST_NO_KVM) and we're not already
# running under KVM. If these conditions are met, enable KVM (and possibly
# nested KVM), otherwise disable it.
if get_bool "${TEST_NESTED_KVM:=}" || (! get_bool "${TEST_NO_KVM:=}" && ! systemd-detect-virt -qv); then
QEMU_KVM=yes
else
# Check if KVM is not explicitly disabled (TEST_NO_KVM), otherwise
# enable KVM (and possibly nested KVM).
if get_bool "${TEST_NO_KVM:=}"; then
QEMU_KVM=no
else
QEMU_KVM=yes
fi
if ! ROOTLIBDIR=$(pkg-config --variable=systemdutildir systemd); then