qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent


From: Alex Bennée
Subject: Re: [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent from accelerator
Date: Fri, 30 Apr 2021 16:35:34 +0100
User-agent: mu4e 1.5.12; emacs 28.0.50

Philippe Mathieu-Daudé <philmd@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 an assertion.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Since v1: use global tcg_accel_available, call qtest_has_accel() once
> ---
>  tests/qtest/bios-tables-test.c | 99 ++++++++++++++++++----------------
>  1 file changed, 52 insertions(+), 47 deletions(-)
>
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index 156d4174aa3..a4c7bddf6f3 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -97,6 +97,7 @@ typedef struct {
>      QTestState *qts;
>  } test_data;
>  
> +static bool tcg_accel_available;
>  static char disk[] = "tests/acpi-test-disk-XXXXXX";
>  static const char *data_dir = "tests/data/acpi";
>  #ifdef CONFIG_IASL
> @@ -718,15 +719,11 @@ static void test_acpi_one(const char *params, test_data 
> *data)
>      char *args;
>      bool use_uefi = data->uefi_fl1 && data->uefi_fl2;
>  
> -#ifndef CONFIG_TCG
> -    if (data->tcg_only) {
> -        g_test_skip("TCG disabled, skipping ACPI tcg_only test");
> -        return;
> -    }
> -#endif /* CONFIG_TCG */
> +    assert(!data->tcg_only || tcg_accel_available);

I find it odd that we need TCG here (especially on an x86 system) to
test what are essentially device models we use in KVM. On the other hand
it maintains the current effect with less ifdef hacks so:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]