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> Message-id: 9307b70e9876c4e9e3c4478524a32a23a3d5dd05.1499368180.git.alistair.francis@xilinx.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
4871b51b92
commit
55d41b16ee
|
@ -71,6 +71,7 @@ void aio_set_fd_handler(AioContext *ctx,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HANDLE event;
|
HANDLE event;
|
||||||
|
long bitmask = 0;
|
||||||
|
|
||||||
if (node == NULL) {
|
if (node == NULL) {
|
||||||
/* Alloc and insert if it's not already there */
|
/* 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->io_write = io_write;
|
||||||
node->is_external = is_external;
|
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);
|
event = event_notifier_get_handle(&ctx->notifier);
|
||||||
WSAEventSelect(node->pfd.fd, event,
|
WSAEventSelect(node->pfd.fd, event, bitmask);
|
||||||
FD_READ | FD_ACCEPT | FD_CLOSE |
|
|
||||||
FD_CONNECT | FD_WRITE | FD_OOB);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_lockcnt_unlock(&ctx->list_lock);
|
qemu_lockcnt_unlock(&ctx->list_lock);
|
||||||
|
|
Loading…
Reference in New Issue