qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] io: simplify qio_channel_attach_aio_context
Date: Fri, 26 May 2017 10:59:01 +0100	[thread overview]
Message-ID: <20170526095901.GB24484@redhat.com> (raw)
In-Reply-To: <20170526093641.7159-1-pbonzini@redhat.com>

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 <pbonzini@redhat.com>
> ---
>  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	other threads:[~2017-05-26  9:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26  9:36 [Qemu-devel] [PATCH] io: simplify qio_channel_attach_aio_context Paolo Bonzini
2017-05-26  9:59 ` Daniel P. Berrange [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-04-27 10:15 Paolo Bonzini
2017-04-27 12:14 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170526095901.GB24484@redhat.com \
    --to=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).