|
From: | Thomas Huth |
Subject: | Re: [PATCH v8 08/11] tests/qtest: Fix tests when no KVM or TCG are present |
Date: | Fri, 10 Mar 2023 16:17:55 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 |
On 10/03/2023 14.06, Fabiano Rosas wrote:
"Michael S. Tsirkin" <mst@redhat.com> writes:On Thu, Mar 09, 2023 at 05:14:31PM -0300, Fabiano Rosas wrote: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. Fix 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. Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>I don't like it that we are hard-coding the list of accelerators like this. Make a wrapper?Are you thinking of some sort of "has_any_accel" wrapper?
I think in the long run, we want something like what I described here: https://lore.kernel.org/qemu-devel/ee0cad00-a6f3-f0c1-adf0-ba32329354f3@redhat.com/
@@ -2120,6 +2119,13 @@ int main(int argc, char *argv[])g_test_init(&argc, &argv, NULL); + has_kvm = qtest_has_accel("kvm");+ has_tcg = qtest_has_accel("tcg"); +why are you moving these? init at declaration time is generally cleaner.Thomas had asked me to put calls to qtest_has_accel after g_test_init. I just brought the existing one along for consistency. From the commit message: "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."
Right, otherwise this might cause problems with the latest version of glib (in Fedora, I think).
Thomas
[Prev in Thread] | Current Thread | [Next in Thread] |