qemu-devel
[Top][All Lists]
Advanced

[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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]