All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com, famz@redhat.com,
	alistair23@gmail.com, edgar iglesias <edgar.iglesias@xilinx.com>,
	qemu-block@nongnu.org, philippe@mathieu-daude.net
Subject: Re: [Qemu-devel] [PATCH v2 1/1] util/aio-win32: Only select on what we are actually waiting for
Date: Thu, 6 Jul 2017 19:13:49 -0400 (EDT)	[thread overview]
Message-ID: <1454897311.14540623.1499382829440.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <9307b70e9876c4e9e3c4478524a32a23a3d5dd05.1499368180.git.alistair.francis@xilinx.com>

Looks good, but I noticed now that you may want to do that for
qio_channel_create_socket_watch too.

Paolo

----- Original Message -----
> From: "Alistair Francis" <alistair.francis@xilinx.com>
> To: qemu-devel@nongnu.org, stefanha@redhat.com, famz@redhat.com
> Cc: "alistair francis" <alistair.francis@xilinx.com>, alistair23@gmail.com, "edgar iglesias"
> <edgar.iglesias@xilinx.com>, qemu-block@nongnu.org, philippe@mathieu-daude.net, pbonzini@redhat.com
> Sent: Thursday, July 6, 2017 10:15:14 PM
> Subject: [PATCH v2 1/1] util/aio-win32: Only select on what we are actually waiting for
> 
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Changes in V2:
>  - Rebase on master
> Changes since RFC:
>  - Include more bitmasks for the select call
> 
>  util/aio-win32.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/util/aio-win32.c b/util/aio-win32.c
> index bca496a47a..d6d5e02f00 100644
> --- a/util/aio-win32.c
> +++ b/util/aio-win32.c
> @@ -71,6 +71,7 @@ void aio_set_fd_handler(AioContext *ctx,
>          }
>      } else {
>          HANDLE event;
> +        long bitmask = 0;
>  
>          if (node == NULL) {
>              /* Alloc and insert if it's not already there */
> @@ -95,10 +96,16 @@ void aio_set_fd_handler(AioContext *ctx,
>          node->io_write = io_write;
>          node->is_external = is_external;
>  
> +        if (io_read) {
> +            bitmask |= FD_READ | FD_ACCEPT | FD_CLOSE;
> +        }
> +
> +        if (io_write) {
> +            bitmask |= FD_WRITE | FD_CONNECT;
> +        }
> +
>          event = event_notifier_get_handle(&ctx->notifier);
> -        WSAEventSelect(node->pfd.fd, event,
> -                       FD_READ | FD_ACCEPT | FD_CLOSE |
> -                       FD_CONNECT | FD_WRITE | FD_OOB);
> +        WSAEventSelect(node->pfd.fd, event, bitmask);
>      }
>  
>      qemu_lockcnt_unlock(&ctx->list_lock);
> --
> 2.11.0
> 
> 

  reply	other threads:[~2017-07-06 23:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 20:15 [Qemu-devel] [PATCH v2 1/1] util/aio-win32: Only select on what we are actually waiting for Alistair Francis
2017-07-06 23:13 ` Paolo Bonzini [this message]
2017-07-07 12:36 ` Stefan Hajnoczi

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=1454897311.14540623.1499382829440.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alistair.francis@xilinx.com \
    --cc=alistair23@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=famz@redhat.com \
    --cc=philippe@mathieu-daude.net \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.