From c428b392590df6364a025d5841e3e8a589ebfd4a Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 8 Sep 2023 09:54:58 +0200 Subject: [PATCH] block: mark aio_poll as non-coroutine It is forbidden to block on the event loop during a coroutine, as that can cause deadlocks due to recursive locking. Signed-off-by: Paolo Bonzini Message-ID: <20230908075458.527013-1-pbonzini@redhat.com> Reviewed-by: Michael Tokarev Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/aio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/block/aio.h b/include/block/aio.h index bcc165c974..f08b358077 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -467,7 +467,7 @@ void aio_dispatch(AioContext *ctx); * or more AIO events have completed, to ensure something has moved * before returning. */ -bool aio_poll(AioContext *ctx, bool blocking); +bool no_coroutine_fn aio_poll(AioContext *ctx, bool blocking); /* Register a file descriptor and associated callbacks. Behaves very similarly * to qemu_set_fd_handler. Unlike qemu_set_fd_handler, these callbacks will