From 5540c37bb8b275cb58b1c936ff701d1c80503e9b Mon Sep 17 00:00:00 2001 From: Thomas Blume Date: Thu, 19 Sep 2024 12:02:27 +0200 Subject: [PATCH] test: set TEST_NESTED_KVM as default --- test/README.testsuite | 4 ---- test/test-functions | 12 +++++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/test/README.testsuite b/test/README.testsuite index 60dc03498b..8cacbb40af 100644 --- a/test/README.testsuite +++ b/test/README.testsuite @@ -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). diff --git a/test/test-functions b/test/test-functions index 64a664b69e..269cd8812b 100644 --- a/test/test-functions +++ b/test/test-functions @@ -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