From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Laurent Vivier <lvivier@redhat.com>,
Thomas Huth <thuth@redhat.com>,
qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Coiby Xu <coiby.xu@gmail.com>, Max Reitz <mreitz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH v2 04/13] util/vhost-user-server: drop unnecessary watch deletion
Date: Thu, 24 Sep 2020 16:15:40 +0100 [thread overview]
Message-ID: <20200924151549.913737-5-stefanha@redhat.com> (raw)
In-Reply-To: <20200924151549.913737-1-stefanha@redhat.com>
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>
---
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
next prev parent reply other threads:[~2020-09-24 15:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 15:15 [PATCH v2 00/13] block/export: convert vhost-user-blk-server to block exports API Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 01/13] block/export: shorten serial string to fit Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 02/13] util/vhost-user-server: s/fileds/fields/ typo fix Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 03/13] util/vhost-user-server: drop unnecessary QOM cast Stefan Hajnoczi
2020-09-24 15:15 ` Stefan Hajnoczi [this message]
2020-09-24 15:15 ` [PATCH v2 05/13] block/export: consolidate request structs into VuBlockReq Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 06/13] util/vhost-user-server: drop unused DevicePanicNotifier Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 07/13] util/vhost-user-server: fix memory leak in vu_message_read() Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 08/13] util/vhost-user-server: check EOF when reading payload Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 09/13] util/vhost-user-server: rework vu_client_trip() coroutine lifecycle Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 10/13] block/export: report flush errors Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 11/13] block/export: convert vhost-user-blk server to block export API Stefan Hajnoczi
2020-09-30 5:28 ` Markus Armbruster
2020-09-30 9:45 ` Stefan Hajnoczi
2020-09-30 14:33 ` Markus Armbruster
2020-10-01 15:25 ` Stefan Hajnoczi
2020-10-02 5:20 ` Markus Armbruster
2020-10-08 16:02 ` Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 12/13] util/vhost-user-server: move header to include/ Stefan Hajnoczi
2020-09-24 15:15 ` [PATCH v2 13/13] util/vhost-user-server: use static library in meson.build Stefan Hajnoczi
2020-10-09 10:18 ` [PATCH v2 00/13] block/export: convert vhost-user-blk-server to block exports API Stefan Hajnoczi
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=20200924151549.913737-5-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=coiby.xu@gmail.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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).