[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/13] block/export: only acquire AioContext once for vhost_user_
From: |
Stefan Hajnoczi |
Subject: |
[PATCH 03/13] block/export: only acquire AioContext once for vhost_user_server_stop() |
Date: |
Mon, 3 Apr 2023 14:29:54 -0400 |
vhost_user_server_stop() uses AIO_WAIT_WHILE(). AIO_WAIT_WHILE()
requires that AioContext is only acquired once.
Since blk_exp_request_shutdown() already acquires the AioContext it
shouldn't be acquired again in vhost_user_server_stop().
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
util/vhost-user-server.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index 40f36ea214..5b6216069c 100644
--- a/util/vhost-user-server.c
+++ b/util/vhost-user-server.c
@@ -346,10 +346,9 @@ static void vu_accept(QIONetListener *listener,
QIOChannelSocket *sioc,
aio_context_release(server->ctx);
}
+/* server->ctx acquired by caller */
void vhost_user_server_stop(VuServer *server)
{
- aio_context_acquire(server->ctx);
-
qemu_bh_delete(server->restart_listener_bh);
server->restart_listener_bh = NULL;
@@ -366,8 +365,6 @@ void vhost_user_server_stop(VuServer *server)
AIO_WAIT_WHILE(server->ctx, server->co_trip);
}
- aio_context_release(server->ctx);
-
if (server->listener) {
qio_net_listener_disconnect(server->listener);
object_unref(OBJECT(server->listener));
--
2.39.2
- [PATCH 00/13] block: remove aio_disable_external() API, Stefan Hajnoczi, 2023/04/03
- [PATCH 02/13] virtio-scsi: stop using aio_disable_external() during unplug, Stefan Hajnoczi, 2023/04/03
- [PATCH 05/13] block/export: wait for vhost-user-blk requests when draining, Stefan Hajnoczi, 2023/04/03
- [PATCH 06/13] block/export: stop using is_external in vhost-user-blk server, Stefan Hajnoczi, 2023/04/03
- [PATCH 03/13] block/export: only acquire AioContext once for vhost_user_server_stop(),
Stefan Hajnoczi <=
- [PATCH 08/13] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore, Stefan Hajnoczi, 2023/04/03
- [PATCH 04/13] util/vhost-user-server: rename refcount to in_flight counter, Stefan Hajnoczi, 2023/04/03
- [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event, Stefan Hajnoczi, 2023/04/03
- [PATCH 09/13] hw/xen: do not set is_external=true on evtchn fds, Stefan Hajnoczi, 2023/04/03