tests/qtest: Fix tests when no KVM or TCG are present
commit0c1ae3ff9dedd8a77bad5508413ccdcfc2493df6
authorFabiano Rosas <farosas@suse.de>
Wed, 26 Apr 2023 18:00:08 +0000 (26 15:00 -0300)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 2 May 2023 09:54:32 +0000 (2 10:54 +0100)
treef33da91e105473b9991bc43edd31f4d29bf11b8c
parent20cf68efcec25b1d95cfe3659aded5314bd1b819
tests/qtest: Fix tests when no KVM or TCG are present

It is possible to have a build with both TCG and KVM disabled due to
Xen requiring the i386 and x86_64 binaries to be present in an aarch64
host.

If we build with --disable-tcg on the aarch64 host, we will end-up
with a QEMU binary (x86) that does not support TCG nor KVM.

Skip tests that crash or hang in the above scenario. Do not include
any test cases if TCG and KVM are missing.

Make sure that calls to qtest_has_accel are placed after g_test_init
in similar fashion to commit ae4b01b349 ("tests: Ensure TAP version is
printed before other messages") to avoid TAP parsing errors.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230426180013.14814-9-farosas@suse.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
tests/qtest/bios-tables-test.c
tests/qtest/boot-serial-test.c
tests/qtest/migration-test.c
tests/qtest/pxe-test.c
tests/qtest/vmgenid-test.c