Philippe Mathieu-Daudé <phi...@redhat.com> writes: > On 4/29/21 3:22 PM, Markus Armbruster wrote: >> Philippe Mathieu-Daudé <phi...@redhat.com> writes: >>>>> Now than we can probe if the TCG accelerator is available >>>>> at runtime with a QMP command, do it once at the beginning >>>>> and only register the tests we can run. >>>>> We can then replace the #ifdef'ry by a runtime check. >>>>> >>>>> Suggested-by: Paolo Bonzini <pbonz...@redhat.com> >>>>> Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> >>>> >>>> Please read the last remark first. The other ones are detail; feel free >>>> to skip them until we're done with the last one. >>>> >>>>> --- >>>>> tests/qtest/qmp-cmd-test.c | 18 ++++++++++++++---- >>>>> 1 file changed, 14 insertions(+), 4 deletions(-) >>> >>>>> + tcg_accel_available = qtest_has_accel("tcg"); >>>>> + >>>> >>>> When does tcg_accel_available differ from defined(CONFIG_TCG)? >>> >>> qtest_has_accel("tcg") is a runtime check, while defined(CONFIG_TCG) >>> is build-time. >> >> Let me rephrase my question: under what conditions can the values of >> qtest_has_accel("tcg") and defined(CONFIG_TCG) differ? > > They are currently the same, so this patch is a no-op. *But* it > allows us to remove the global dependence on CONFIG_TCG in the > Meson machinery (see the last commit in this series). > > Is that missing part of the commit description? > > "This will allow us to remove the global CONFIG_TCG dependency > in our Meson machinery in a pair of commits."?
Do you mean "in the next two commits"? Please also note that the probing at run-time always gives the same result as the compile-time check it replaces. I don't understand what exactly the conversion to probing enables and how, but I believe I don't have to. [...]