qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Jie Wang <wangjie88@huawei.com>
Cc: peterx@redhat.com, stefanha@redhat.com, eblake@redhat.com,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	eric.fangyi@huawei.com, wu.wubin@huawei.com
Subject: Re: [Qemu-devel] [PATCH v6 2/2] iothread: let aio_epoll_disable fit to aio_context_destroy
Date: Thu, 17 May 2018 13:56:13 +0800	[thread overview]
Message-ID: <20180517055613.GA3017@lemon.usersys.redhat.com> (raw)
In-Reply-To: <1526523977-73930-1-git-send-email-wangjie88@huawei.com>

On Thu, 05/17 10:26, Jie Wang wrote:
> epoll_available will only be set if epollfd != -1, os we

s/os/so/

> can swap the two variables in aio_epoll_disable, and
> aio_context_destroy can call aio_epoll_disable directly.

If you put this as 1/2 in v7, you do not want to mention the
yet-to-be-introduced aio_context_destroy this way. Maybe you can write as "the
coming aio_context_destroy can call it directly.".

Fam

> 
> Signed-off-by: Jie Wang <wangjie88@huawei.com>
> ---
>  util/aio-posix.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/util/aio-posix.c b/util/aio-posix.c
> index 0ade2c7..118bf57 100644
> --- a/util/aio-posix.c
> +++ b/util/aio-posix.c
> @@ -45,11 +45,11 @@ struct AioHandler
>  
>  static void aio_epoll_disable(AioContext *ctx)
>  {
> -    ctx->epoll_available = false;
> -    if (!ctx->epoll_enabled) {
> +    ctx->epoll_enabled = false;
> +    if (!ctx->epoll_available) {
>          return;
>      }
> -    ctx->epoll_enabled = false;
> +    ctx->epoll_available = false;
>      close(ctx->epollfd);
>  }
>  
> @@ -716,9 +716,7 @@ void aio_context_setup(AioContext *ctx)
>  void aio_context_destroy(AioContext *ctx)
>  {
>  #ifdef CONFIG_EPOLL_CREATE1
> -    if (ctx->epollfd >= 0) {
> -        close(ctx->epollfd);
> -    }
> +    aio_epoll_disable(ctx);
>  #endif
>  }
>  
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2018-05-17  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17  2:26 [Qemu-devel] [PATCH v6 2/2] iothread: let aio_epoll_disable fit to aio_context_destroy Jie Wang
2018-05-17  5:56 ` Fam Zheng [this message]
2018-05-17  6:22 ` Peter Xu
2018-05-17  6:48   ` WangJie (Pluto)
2018-05-18  8:24     ` [Qemu-devel] Ping? " WangJie (Pluto)
2018-05-18  9:12       ` Fam Zheng

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=20180517055613.GA3017@lemon.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eric.fangyi@huawei.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wangjie88@huawei.com \
    --cc=wu.wubin@huawei.com \
    /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).