qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 01/13] qtest: Add set_irq_in command to set I


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH v4 01/13] qtest: Add set_irq_in command to set IRQ/GPIO level
Date: Mon, 5 Nov 2018 07:18:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2018-11-02 18:07, Steffen Görtz wrote:
> Adds a new qtest command "set_irq_in" which allows
> to set qemu gpio lines to a given level.
> 
> Based on https://lists.gnu.org/archive/html/qemu-devel/2012-12/msg02363.html
> which never got merged.
> 
> Signed-off-by: Steffen Görtz <address@hidden>
> Originally-by: Matthew Ogilvie <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---
>  qtest.c          | 43 +++++++++++++++++++++++++++++++++++++++++++
>  tests/libqtest.c | 10 ++++++++++
>  tests/libqtest.h | 28 ++++++++++++++++++++++++++++
>  3 files changed, 81 insertions(+)
[...]
> diff --git a/tests/libqtest.h b/tests/libqtest.h
> index ed88ff99d5..65bffa9ace 100644
> --- a/tests/libqtest.h
> +++ b/tests/libqtest.h
> @@ -232,6 +232,19 @@ void qtest_irq_intercept_in(QTestState *s, const char 
> *string);
>   */
>  void qtest_irq_intercept_out(QTestState *s, const char *string);
>  
> +/**
> + * qtest_set_irq_in:
> + * @s: QTestState instance to operate on.
> + * @string: QOM path of a device
> + * @name: IRQ name
> + * @irq: IRQ number
> + * @level: IRQ level
> + *
> + * Force given device/irq GPIO-in pin to the given level.
> + */
> +void qtest_set_irq_in(QTestState *s, const char *string, const char *name,
> +                      int irq, int level);
> +
>  /**
>   * qtest_outb:
>   * @s: #QTestState instance to operate on.
> @@ -678,6 +691,21 @@ static inline void irq_intercept_out(const char *string)
>      qtest_irq_intercept_out(global_qtest, string);
>  }
>  
> +/**
> + * qtest_set_irq_in:
> + * @string: QOM path of a device
> + * @name: IRQ name
> + * @irq: IRQ number
> + * @level: IRQ level
> + *
> + * Force given device/IRQ GPIO-in pin to the given level.
> + */
> +static inline void set_irq_in(const char *string, const char *name,
> +                              int irq, int level)
> +{
> +    qtest_set_irq_in(global_qtest, string, name, irq, level);
> +}
> +
>  /**
>   * outb:
>   * @addr: I/O port to write to.
> 

 Hi Steffen,

please don't add any new function wrappers around global_qtest anymore.
We recently already started to get rid of this global variable in a
couple of places (see
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=db57d7a3c284db2315d9 and
preceding commits for example), since it causes trouble in tests that
want to run multiple QEMU instances at once (in migration tests for
example). It would be good to have new code clean for this right from
the start.

 Thanks,
  Thomas



reply via email to

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