On 3/12/21 10:05 AM, Paolo Bonzini wrote:
On 12/03/21 00:12, Philippe Mathieu-Daudé wrote:
-#define MACHINE_KVM "-machine virt,gic-version=max -accel kvm -accel
tcg "
+#define MACHINE_KVM "-machine virt,gic-version=max -accel kvm "
Wouldn't qtest_init simply fail here if KVM is not available?
I guess my previous approach was what you suggested.
The previous patch (bios-tables-test) is a better example:
g_autofree char *args = NULL;
args = test_acpi_create_args(data, params, use_uefi);
data->qts = qtest_init_for_accel(args, "tcg");
if (data->tcg_only && !data->qts) {
g_test_skip("TCG not available, skipping test");
return;
} else {
// check data->qts or the following will abort
}
Having qtest_init_for_accel() calling qtest_quit(),
but this makes the tests logic more complex IMO...
Is that what you have in mind?