[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/6] tests/qtest: Add qtest_probe_accel() method
From: |
Andrew Jones |
Subject: |
Re: [PATCH 2/6] tests/qtest: Add qtest_probe_accel() method |
Date: |
Fri, 12 Mar 2021 09:58:54 +0100 |
On Fri, Mar 12, 2021 at 09:16:01AM +0100, Thomas Huth wrote:
> On 12/03/2021 00.11, Philippe Mathieu-Daudé wrote:
> > Introduce the qtest_probe_accel() method which allows
> > to query at runtime if a QEMU instance has an accelerator
> > built-in.
> >
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> > tests/qtest/libqos/libqtest.h | 9 +++++++++
> > tests/qtest/libqtest.c | 24 ++++++++++++++++++++++++
> > 2 files changed, 33 insertions(+)
> >
> > diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h
> > index a68dcd79d44..ebedb82ec98 100644
> > --- a/tests/qtest/libqos/libqtest.h
> > +++ b/tests/qtest/libqos/libqtest.h
> > @@ -763,6 +763,15 @@ void qmp_expect_error_and_unref(QDict *rsp, const char
> > *class);
> > */
> > bool qtest_probe_child(QTestState *s);
> > +/**
> > + * qtest_probe_accel:
> > + * @s: QTestState instance to operate on.
> > + * @name: Accelerator name to check for.
> > + *
> > + * Returns: true if the accelerator is built in.
> > + */
> > +bool qtest_probe_accel(QTestState *s, const char *name);
>
> Maybe better qtest_has_accel() ? ... that makes it clear right from the
> start what the return type is about.
It looks like qtest_probe_accel() is getting used in contexts in the
following patches that would be better suited with an "enabled" API
qtest_accel_enabled(s, accel_name)
So, I think we should create that interface. Do we also need a
qtest_has_accel()? Does it matter which ones have been compiled
in when they're not active?
(Hmm, 'active' might be a better verb yet. qtest_accel_active() ?)
Thanks,
drew
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, (continued)
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Paolo Bonzini, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Markus Armbruster, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Markus Armbruster, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Thomas Huth, 2021/03/16
- Re: [PATCH 1/6] accel: Introduce 'query-accels' QMP command, Philippe Mathieu-Daudé, 2021/03/16
[PATCH 2/6] tests/qtest: Add qtest_probe_accel() method, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 4/6] qtest/arm-cpu-features: Check KVM availability at runtime, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 3/6] qtest/bios-tables-test: Make test build-independent from accelerator, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 5/6] qtest/arm-cpu-features: Check TCG availability at runtime, Philippe Mathieu-Daudé, 2021/03/11
[PATCH 6/6] tests/qtest: Do not restrict bios-tables-test to Aarch64 hosts anymore, Philippe Mathieu-Daudé, 2021/03/11