qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] io: simplify qio_channel_attach_aio_context


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH] io: simplify qio_channel_attach_aio_context
Date: Fri, 26 May 2017 10:59:01 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

On Fri, May 26, 2017 at 11:36:41AM +0200, Paolo Bonzini wrote:
> If properly preceded by qio_channel_detach_aio_context, this function really
> has nothing to do except setting ioc->ctx.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  io/channel.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/io/channel.c b/io/channel.c
> index cdf74540c1..1cfb8b33a2 100644
> --- a/io/channel.c
> +++ b/io/channel.c
> @@ -279,15 +279,9 @@ static void qio_channel_set_aio_fd_handlers(QIOChannel 
> *ioc)
>  void qio_channel_attach_aio_context(QIOChannel *ioc,
>                                      AioContext *ctx)
>  {
> -    AioContext *old_ctx;
> -    if (ioc->ctx == ctx) {
> -        return;
> -    }
> -
> -    old_ctx = ioc->ctx ? ioc->ctx : iohandler_get_aio_context();
> -    qio_channel_set_aio_fd_handler(ioc, old_ctx, NULL, NULL, NULL);
> +    assert(!ioc->read_coroutine);
> +    assert(!ioc->write_coroutine);
>      ioc->ctx = ctx;
> -    qio_channel_set_aio_fd_handlers(ioc);
>  }
>  
>  void qio_channel_detach_aio_context(QIOChannel *ioc)

Thanks, queued

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



reply via email to

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