tests/qtest/libqtest: add qtest_has_cpu_model() api

Added a new test api qtest_has_cpu_model() in order to check availability of
some cpu models in the current QEMU binary. The specific architecture of the
QEMU binary is selected using the QTEST_QEMU_BINARY environment variable.
This api would be useful to run tests against some older cpu models after
checking if QEMU actually supported these models.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20240610155303.7933-3-anisinha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Ani Sinha 2024-06-10 21:22:59 +05:30 committed by Thomas Huth
parent 07c8d9ac0f
commit f43f8abe45
2 changed files with 91 additions and 0 deletions

View file

@ -949,6 +949,14 @@ bool qtest_has_machine(const char *machine);
*/
bool qtest_has_machine_with_env(const char *var, const char *machine);
/**
* qtest_has_cpu_model:
* @cpu: The cpu to look for
*
* Returns: true if the cpu is available in the target binary.
*/
bool qtest_has_cpu_model(const char *cpu);
/**
* qtest_has_device:
* @device: The device to look for