aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-coroutine.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/qemu-coroutine.c')
-rw-r--r--util/qemu-coroutine.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
index 486af9a622..d6095c1d5a 100644
--- a/util/qemu-coroutine.c
+++ b/util/qemu-coroutine.c
@@ -126,6 +126,11 @@ void qemu_aio_coroutine_enter(AioContext *ctx, Coroutine *co)
qemu_co_queue_run_restart(co);
+ /* Beware, if ret == COROUTINE_YIELD and qemu_co_queue_run_restart()
+ * has started any other coroutine, "co" might have been reentered
+ * and even freed by now! So be careful and do not touch it.
+ */
+
switch (ret) {
case COROUTINE_YIELD:
return;