qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair.francis@xilinx.com>
To: qemu-devel@nongnu.org, stefanha@redhat.com, famz@redhat.com
Cc: alistair.francis@xilinx.com, alistair23@gmail.com,
	edgar.iglesias@xilinx.com, qemu-block@nongnu.org,
	philippe@mathieu-daude.net, pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH v1 1/3] util/aio-win32: Only select on what we are actually waiting for
Date: Thu, 29 Jun 2017 10:16:30 -0700	[thread overview]
Message-ID: <ec037b86d3144d26ebdbb943515d2da02725d465.1498756113.git.alistair.francis@xilinx.com> (raw)
In-Reply-To: <cover.1498756113.git.alistair.francis@xilinx.com>

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
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-06-29 17:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 17:16 [Qemu-devel] [PATCH v1 0/3] Windows runtime improvements Alistair Francis
2017-06-29 17:16 ` Alistair Francis [this message]
2017-06-29 17:29   ` [Qemu-devel] [PATCH v1 1/3] util/aio-win32: Only select on what we are actually waiting for Philippe Mathieu-Daudé
2017-06-29 17:16 ` [Qemu-devel] [PATCH v1 2/3] util/oslib-win32: Remove invalid check Alistair Francis
2017-06-30 10:03   ` Paolo Bonzini
2017-06-30 10:05   ` Peter Maydell
2017-06-29 17:16 ` [Qemu-devel] [PATCH v1 3/3] util/oslib-win32: Remove if conditional Alistair Francis
2017-07-06  8:29 ` [Qemu-devel] [PATCH v1 0/3] Windows runtime improvements 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=ec037b86d3144d26ebdbb943515d2da02725d465.1498756113.git.alistair.francis@xilinx.com \
    --to=alistair.francis@xilinx.com \
    --cc=alistair23@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=famz@redhat.com \
    --cc=pbonzini@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 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).