[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 32/38] libqtest: Merge qtest_irq*() with irq*
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v7 32/38] libqtest: Merge qtest_irq*() with irq*() |
Date: |
Tue, 12 Sep 2017 12:47:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 11.09.2017 19:20, Eric Blake wrote:
> Maintaining two layers of libqtest APIs, one that takes an explicit
> QTestState object, and the other that uses the implicit global_qtest,
> is annoying. In the interest of getting rid of global implicit
> state and having less code to maintain, merge:
> qtest_get_irq()
> qtest_irq_intercept_in()
> qtest_irq_intercept_out()
> with their short counterparts. All callers that previously
> used the short form now make it explicit that they are relying on
> global_qtest, and later patches can then clean things up to remove
> the global variable.
>
> Signed-off-by: Eric Blake <address@hidden>
> ---
> tests/libqtest.h | 47 ++++++-----------------------------------------
> tests/libqtest.c | 6 +++---
> tests/fdc-test.c | 48
> ++++++++++++++++++++++++------------------------
> tests/ide-test.c | 17 +++++++++--------
> tests/ipmi-bt-test.c | 6 +++---
> tests/ipmi-kcs-test.c | 8 ++++----
> tests/libqos/libqos-pc.c | 2 +-
> tests/rtc-test.c | 10 +++++-----
> tests/tco-test.c | 2 +-
> tests/wdt_ib700-test.c | 8 ++++----
> 10 files changed, 60 insertions(+), 94 deletions(-)
>
> diff --git a/tests/libqtest.h b/tests/libqtest.h
> index 26d5f37bc9..8398c0fd07 100644
> --- a/tests/libqtest.h
> +++ b/tests/libqtest.h
> @@ -176,33 +176,33 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...)
> GCC_FMT_ATTR(2, 3);
> char *qtest_hmpv(QTestState *s, const char *fmt, va_list ap);
>
> /**
> - * qtest_get_irq:
> + * get_irq:
> * @s: #QTestState instance to operate on.
> * @num: Interrupt to observe.
> *
> * Returns: The level of the @num interrupt.
> */
> -bool qtest_get_irq(QTestState *s, int num);
> +bool get_irq(QTestState *s, int num);
>
> /**
> - * qtest_irq_intercept_in:
> + * irq_intercept_in:
> * @s: #QTestState instance to operate on.
> * @string: QOM path of a device.
> *
> * Associate qtest irqs with the GPIO-in pins of the device
> * whose path is specified by @string.
> */
> -void qtest_irq_intercept_in(QTestState *s, const char *string);
> +void irq_intercept_in(QTestState *s, const char *string);
>
> /**
> - * qtest_irq_intercept_out:
> + * irq_intercept_out:
> * @s: #QTestState instance to operate on.
> * @string: QOM path of a device.
> *
> * Associate qtest irqs with the GPIO-out pins of the device
> * whose path is specified by @string.
> */
> -void qtest_irq_intercept_out(QTestState *s, const char *string);
> +void irq_intercept_out(QTestState *s, const char *string);
Could we please also keep the qtest prefix here?
Thomas
[Qemu-devel] [PATCH v7 33/38] libqtest: Merge qtest_{in, out}[bwl]() with {in, out}[bwl](), Eric Blake, 2017/09/11
[Qemu-devel] [PATCH v7 36/38] libqtest: Merge qtest_memset() with qmemset(), Eric Blake, 2017/09/11
[Qemu-devel] [PATCH v7 35/38] libqtest: Merge qtest_{mem, buf}{read, write}() with {mem, buf}{read, write}(), Eric Blake, 2017/09/11
[Qemu-devel] [PATCH v7 38/38] libqtest: Merge qtest_hmp() with hmp(), Eric Blake, 2017/09/11