Skip to contentSkip to conversation

block/export: only acquire AioContext once for vhost_user_server_stop()

PATCH Applied Stefan Hajnoczi 2 participants 2 messages Mar 23, 2023 – Mar 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/export: only acquire AioContext once for vhost_user_server_stop()

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().

---
 util/vhost-user-server.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
util/vhost-user-server.c +1 -4
index 40f36ea214..5b6216069c 100644
@@ -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));
Signature · 1 line
2.39.2
Applied
#1 lore raw

Am 23.03.2023 um 15:58 hat Stefan Hajnoczi geschrieben:

Quoted 7 lines

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().

Thanks, applied to the block branch.

Kevin