[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 11/30] util/vhost-user-server: drop unnecessary watch deletion
From: |
Stefan Hajnoczi |
Subject: |
[PULL v2 11/30] util/vhost-user-server: drop unnecessary watch deletion |
Date: |
Mon, 12 Oct 2020 19:27:41 +0100 |
Explicitly deleting watches is not necessary since libvhost-user calls
remove_watch() during vu_deinit(). Add an assertion to check this
though.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20200924151549.913737-5-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
util/vhost-user-server.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index ebe47885f5..ebb850731b 100644
--- a/util/vhost-user-server.c
+++ b/util/vhost-user-server.c
@@ -48,21 +48,6 @@ static void close_client(VuServer *server)
/* When this is set vu_client_trip will stop new processing vhost-user
message */
server->sioc = NULL;
- VuFdWatch *vu_fd_watch, *next;
- QTAILQ_FOREACH_SAFE(vu_fd_watch, &server->vu_fd_watches, next, next) {
- aio_set_fd_handler(server->ioc->ctx, vu_fd_watch->fd, true, NULL,
- NULL, NULL, NULL);
- }
-
- while (!QTAILQ_EMPTY(&server->vu_fd_watches)) {
- QTAILQ_FOREACH_SAFE(vu_fd_watch, &server->vu_fd_watches, next, next) {
- if (!vu_fd_watch->processing) {
- QTAILQ_REMOVE(&server->vu_fd_watches, vu_fd_watch, next);
- g_free(vu_fd_watch);
- }
- }
- }
-
while (server->processing_msg) {
if (server->ioc->read_coroutine) {
server->ioc->read_coroutine = NULL;
@@ -73,6 +58,10 @@ static void close_client(VuServer *server)
}
vu_deinit(&server->vu_dev);
+
+ /* vu_deinit() should have called remove_watch() */
+ assert(QTAILQ_EMPTY(&server->vu_fd_watches));
+
object_unref(OBJECT(sioc));
object_unref(OBJECT(server->ioc));
}
--
2.26.2
- [PULL v2 01/30] block/nvme: Add driver statistics for access alignment and hw errors, (continued)
- [PULL v2 01/30] block/nvme: Add driver statistics for access alignment and hw errors, Stefan Hajnoczi, 2020/10/12
- [PULL v2 02/30] libvhost-user: Allow vu_message_read to be replaced, Stefan Hajnoczi, 2020/10/12
- [PULL v2 03/30] libvhost-user: remove watch for kick_fd when de-initialize vu-dev, Stefan Hajnoczi, 2020/10/12
- [PULL v2 04/30] util/vhost-user-server: generic vhost user server, Stefan Hajnoczi, 2020/10/12
- [PULL v2 06/30] block/export: vhost-user block device backend server, Stefan Hajnoczi, 2020/10/12
- [PULL v2 08/30] MAINTAINERS: Add vhost-user block device backend server maintainer, Stefan Hajnoczi, 2020/10/12
- [PULL v2 10/30] util/vhost-user-server: drop unnecessary QOM cast, Stefan Hajnoczi, 2020/10/12
- [PULL v2 05/30] block: move logical block size check function to a common utility function, Stefan Hajnoczi, 2020/10/12
- [PULL v2 07/30] test: new qTest case to test the vhost-user-blk-server, Stefan Hajnoczi, 2020/10/12
- [PULL v2 12/30] block/export: consolidate request structs into VuBlockReq, Stefan Hajnoczi, 2020/10/12
- [PULL v2 11/30] util/vhost-user-server: drop unnecessary watch deletion,
Stefan Hajnoczi <=
- [PULL v2 09/30] util/vhost-user-server: s/fileds/fields/ typo fix, Stefan Hajnoczi, 2020/10/12
- [PULL v2 13/30] util/vhost-user-server: drop unused DevicePanicNotifier, Stefan Hajnoczi, 2020/10/12
- [PULL v2 14/30] util/vhost-user-server: fix memory leak in vu_message_read(), Stefan Hajnoczi, 2020/10/12
- [PULL v2 15/30] util/vhost-user-server: check EOF when reading payload, Stefan Hajnoczi, 2020/10/12
- [PULL v2 17/30] block/export: report flush errors, Stefan Hajnoczi, 2020/10/12
- [PULL v2 18/30] block/export: convert vhost-user-blk server to block export API, Stefan Hajnoczi, 2020/10/12
- [PULL v2 19/30] util/vhost-user-server: move header to include/, Stefan Hajnoczi, 2020/10/12
- [PULL v2 16/30] util/vhost-user-server: rework vu_client_trip() coroutine lifecycle, Stefan Hajnoczi, 2020/10/12
- [PULL v2 20/30] util/vhost-user-server: use static library in meson.build, Stefan Hajnoczi, 2020/10/12
- [PULL v2 21/30] qemu-storage-daemon: avoid compiling blockdev_ss twice, Stefan Hajnoczi, 2020/10/12