diff options
-rw-r--r-- | block/io.c | 1 | ||||
-rw-r--r-- | util/aio-win32.c | 13 |
2 files changed, 10 insertions, 4 deletions
diff --git a/block/io.c b/block/io.c index aece54c015..d9dc822173 100644 --- a/block/io.c +++ b/block/io.c @@ -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 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); |