From: Stefan Hajnoczi <stefanha@redhat.com>
To: Coiby Xu <coiby.xu@gmail.com>
Cc: kwolf@redhat.com, bharatlkmlkvm@gmail.com, qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [PATCH 4/6] vhost-user-server: mark fd handlers "external"
Date: Fri, 19 Jun 2020 13:00:44 +0100 [thread overview]
Message-ID: <20200619120046.2422205-4-stefanha@redhat.com> (raw)
In-Reply-To: <20200619120046.2422205-1-stefanha@redhat.com>
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
next prev parent reply other threads:[~2020-06-19 12:02 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 18:39 [PATCH v9 0/5] vhost-user block device backend implementation Coiby Xu
2020-06-14 18:39 ` [PATCH v9 1/5] Allow vu_message_read to be replaced Coiby Xu
2020-06-18 10:43 ` Kevin Wolf
2020-06-24 3:36 ` Coiby Xu
2020-06-24 12:24 ` Kevin Wolf
2020-06-14 18:39 ` [PATCH v9 2/5] generic vhost user server Coiby Xu
2020-06-18 13:29 ` Kevin Wolf
2020-08-17 8:59 ` Coiby Xu
2020-06-19 12:00 ` [PATCH 1/6] vhost-user-server: fix VHOST_MEMORY_MAX_REGIONS compiler error Stefan Hajnoczi
2020-06-19 12:00 ` [PATCH 2/6] vhost-user-server: drop unused #include <eventfd.h> Stefan Hajnoczi
2020-08-17 12:49 ` Coiby Xu
2020-08-18 15:11 ` Stefan Hajnoczi
2020-06-19 12:00 ` [PATCH 3/6] vhost-user-server: adjust vhost_user_server_set_aio_context() arguments Stefan Hajnoczi
2020-06-19 12:00 ` Stefan Hajnoczi [this message]
2020-06-19 12:00 ` [PATCH 5/6] vhost-user-server: fix s/initialized/initialize/ typo Stefan Hajnoczi
2020-06-19 12:00 ` [PATCH 6/6] vhost-user-server: use DevicePanicNotifierFn everywhere Stefan Hajnoczi
2020-06-19 12:13 ` [PATCH v9 2/5] generic vhost user server Stefan Hajnoczi
2020-08-17 8:24 ` Coiby Xu
2020-06-14 18:39 ` [PATCH v9 3/5] move logical block size check function to a common utility function Coiby Xu
2020-06-18 13:44 ` Kevin Wolf
2020-06-19 12:01 ` [PATCH 1/6] block-helpers: move MIN/MAX_BLOCK_SIZE constants into header file Stefan Hajnoczi
2020-06-19 12:01 ` [PATCH 2/6] block-helpers: switch to int64_t block size values Stefan Hajnoczi
2020-06-19 12:01 ` [PATCH 3/6] block-helpers: rename check_logical_block_size() to check_block_size() Stefan Hajnoczi
2020-06-19 12:01 ` [PATCH 4/6] block-helpers: use local_err in case errp is NULL Stefan Hajnoczi
2020-06-19 12:01 ` [PATCH 5/6] block-helpers: keep the copyright line from the original file Stefan Hajnoczi
2020-06-19 12:01 ` [PATCH 6/6] block-helpers: update doc comment in gtkdoc style Stefan Hajnoczi
2020-06-14 18:39 ` [PATCH v9 4/5] vhost-user block device backend server Coiby Xu
2020-06-18 15:57 ` Kevin Wolf
2020-08-17 12:30 ` Coiby Xu
2020-06-19 12:03 ` [PATCH 1/2] vhost-user-blk-server: adjust vhost_user_server_set_aio_context() arguments Stefan Hajnoczi
2020-06-19 12:03 ` [PATCH 2/2] vhost-user-blk-server: rename check_logical_block_size() to check_block_size() Stefan Hajnoczi
2020-06-14 18:39 ` [PATCH v9 5/5] new qTest case to test the vhost-user-blk-server Coiby Xu
2020-06-18 15:17 ` Stefan Hajnoczi
2020-06-24 4:35 ` Coiby Xu
2020-06-24 10:49 ` Stefan Hajnoczi
2020-06-24 15:14 ` Thomas Huth
2020-08-17 8:16 ` Coiby Xu
2020-06-14 19:12 ` [PATCH v9 0/5] vhost-user block device backend implementation no-reply
2020-06-14 19:16 ` no-reply
2020-06-16 6:52 ` Coiby Xu
2020-06-18 8:27 ` Stefan Hajnoczi
2020-06-24 4:00 ` Coiby Xu
2020-06-18 8:28 ` Stefan Hajnoczi
2020-08-17 8:23 ` Coiby Xu
2020-06-19 12:07 ` Stefan Hajnoczi
2020-06-24 4:48 ` Coiby Xu
2020-06-25 12:46 ` Coiby Xu
2020-06-26 15:46 ` Stefan Hajnoczi
2020-08-18 15:13 ` Stefan Hajnoczi
2020-09-15 15:35 ` Stefan Hajnoczi
2020-09-18 8:13 ` Coiby Xu
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=20200619120046.2422205-4-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=bharatlkmlkvm@gmail.com \
--cc=coiby.xu@gmail.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).