[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] vhost-user-server: mark fd handlers "external"
From: |
Stefan Hajnoczi |
Subject: |
[PATCH 4/6] vhost-user-server: mark fd handlers "external" |
Date: |
Fri, 19 Jun 2020 13:00:44 +0100 |
The event loop has the concept of "external" fd handlers that process
requests from outside clients such as the guest. External fd handlers
are disabled during critical sections where new requests are not
allowed.
The vhost-user-server seems like an "external" client to me and
therefore should mark its file descriptors "external".
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
util/vhost-user-server.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index 5230ba3883..a5785cbf86 100644
--- a/util/vhost-user-server.c
+++ b/util/vhost-user-server.c
@@ -235,7 +235,7 @@ set_watch(VuDev *vu_dev, int fd, int vu_evt,
kick_info->fd = fd;
kick_info->cb = cb;
qemu_set_nonblock(fd);
- aio_set_fd_handler(server->ioc->ctx, fd, false, kick_handler,
+ aio_set_fd_handler(server->ioc->ctx, fd, true, kick_handler,
NULL, NULL, kick_info);
kick_info->vu_dev = vu_dev;
}
@@ -262,7 +262,7 @@ static void remove_watch(VuDev *vu_dev, int fd)
return;
}
server->kick_info[i].cb = NULL;
- aio_set_fd_handler(server->ioc->ctx, fd, false, NULL, NULL, NULL, NULL);
+ aio_set_fd_handler(server->ioc->ctx, fd, true, NULL, NULL, NULL, NULL);
}
@@ -333,7 +333,7 @@ static void detach_context(VuServer *server)
qio_channel_detach_aio_context(server->ioc);
for (i = 0; i < server->vu_dev.max_queues; i++) {
if (server->kick_info[i].cb) {
- aio_set_fd_handler(ctx, server->kick_info[i].fd, false, NULL,
+ aio_set_fd_handler(ctx, server->kick_info[i].fd, true, NULL,
NULL, NULL, NULL);
}
}
@@ -349,7 +349,7 @@ static void attach_context(VuServer *server, AioContext
*ctx)
}
for (i = 0; i < server->vu_dev.max_queues; i++) {
if (server->kick_info[i].cb) {
- aio_set_fd_handler(ctx, server->kick_info[i].fd, false,
+ aio_set_fd_handler(ctx, server->kick_info[i].fd, true,
kick_handler, NULL, NULL,
&server->kick_info[i]);
}
--
2.26.2
- [PATCH v9 0/5] vhost-user block device backend implementation, Coiby Xu, 2020/06/14
- [PATCH v9 1/5] Allow vu_message_read to be replaced, Coiby Xu, 2020/06/14
- [PATCH v9 2/5] generic vhost user server, Coiby Xu, 2020/06/14
- [PATCH v9 3/5] move logical block size check function to a common utility function, Coiby Xu, 2020/06/14
- Re: [PATCH v9 3/5] move logical block size check function to a common utility function, Kevin Wolf, 2020/06/18
- [PATCH 1/6] block-helpers: move MIN/MAX_BLOCK_SIZE constants into header file, Stefan Hajnoczi, 2020/06/19
- [PATCH 2/6] block-helpers: switch to int64_t block size values, Stefan Hajnoczi, 2020/06/19
- [PATCH 3/6] block-helpers: rename check_logical_block_size() to check_block_size(), Stefan Hajnoczi, 2020/06/19
- [PATCH 4/6] block-helpers: use local_err in case errp is NULL, Stefan Hajnoczi, 2020/06/19
- [PATCH 5/6] block-helpers: keep the copyright line from the original file, Stefan Hajnoczi, 2020/06/19
- [PATCH 6/6] block-helpers: update doc comment in gtkdoc style, Stefan Hajnoczi, 2020/06/19
- [PATCH v9 4/5] vhost-user block device backend server, Coiby Xu, 2020/06/14