tests/qtest/display-vga-test: Add proper checks if a device is available
authorThomas Huth <thuth@redhat.com>
Mon, 30 Jan 2023 10:44:43 +0000 (11:44 +0100)
committerThomas Huth <thuth@redhat.com>
Tue, 31 Jan 2023 08:05:26 +0000 (09:05 +0100)
commitf2e57851b831922625f9d364d78c11a0258331a6
tree2a5e2083bbeac4e653cb006e2f349e860d95fa9f
parent7c4f71506f785da0eb4eae98753fe689f4bab351
tests/qtest/display-vga-test: Add proper checks if a device is available

display-vga-test currently tries to guess the usable VGA devices
according to the target architecture that is used for the test.
This of course does not work if QEMU has been built with the
"--without-default-devices" configure switch. To fix this, use the
qtest_has_device() function for the decision instead. This way
we can also consolidate most of the test functions into one single
function (that takes a parameter with the device name now), except
for the multihead test that tries to instantiate two devices and
thus is a little bit different.

Message-Id: <20230130104446.1286773-4-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/display-vga-test.c