Re: [PATCH 3/8] io: add missing coroutine annotation
Philippe Mathieu-Daudé <[email protected]>
| Newsgroups | org.xenproject.lists.xen-devel,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
On 20/7/26 09:55, Marc-André Lureau wrote:
> Fixes: 1edf0df28409 ("io: Add qio_channel_wait_cond() helper")
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
> include/io/channel.h | 4 ++--
> io/channel.c | 5 +++--
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/io/channel.h b/include/io/channel.h
> index 98485c9280a..c90ace20d53 100644
> --- a/include/io/channel.h
> +++ b/include/io/channel.h
> @@ -1016,8 +1016,8 @@ void qio_channel_wait(QIOChannel *ioc,
> * This will work with/without a coroutine context, by automatically select
> * the proper API to wait.
> */
> -void qio_channel_wait_cond(QIOChannel *ioc,
> - GIOCondition condition);
> +void coroutine_mixed_fn qio_channel_wait_cond(QIOChannel *ioc,
Better using same alignment than below (more importantly in
a header), otherwise:
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> + GIOCondition condition);
>
> /**
> * qio_channel_set_aio_fd_handler:
> diff --git a/io/channel.c b/io/channel.c
> index 2853dadb684..620256f310d 100644
> --- a/io/channel.c
> +++ b/io/channel.c
> @@ -905,8 +905,9 @@ void qio_channel_wait(QIOChannel *ioc,
> g_main_context_unref(ctxt);
> }
>
> -void qio_channel_wait_cond(QIOChannel *ioc,
> - GIOCondition condition)
> +void coroutine_mixed_fn
> +qio_channel_wait_cond(QIOChannel *ioc,
> + GIOCondition condition)
> {
> if (qemu_in_coroutine()) {
> qio_channel_yield(ioc, condition);
>