diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-07-18 13:09:51 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-07-18 13:09:51 +0100 |
commit | 718d7f4f9cf772e5784093d8e6085680a235acdb (patch) | |
tree | e6754e6f1f280fa1530fe3a20a0f30cb6988ab83 | |
parent | ed6458726a9d987f5466f7b92469085d2a2d3685 (diff) | |
parent | 593ed6f0a3c827a13a274e47f6fa980344234f9c (diff) | |
download | qemu-718d7f4f9cf772e5784093d8e6085680a235acdb.zip qemu-718d7f4f9cf772e5784093d8e6085680a235acdb.tar.gz qemu-718d7f4f9cf772e5784093d8e6085680a235acdb.tar.bz2 |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Mon 17 Jul 2017 16:40:18 BST
# gpg: using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request:
block: fix shadowed variable in bdrv_co_pdiscard
util/aio-win32: Only select on what we are actually waiting for
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | block/io.c | 1 | ||||
-rw-r--r-- | util/aio-win32.c | 13 |
2 files changed, 10 insertions, 4 deletions
@@ -2359,7 +2359,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, assert(max_pdiscard >= bs->bl.request_alignment); while (bytes > 0) { - int ret; int num = bytes; if (head) { diff --git a/util/aio-win32.c b/util/aio-win32.c index bca496a..d6d5e02 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); |