[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.0.2 04/22] Revert "monitor: use aio_co_reschedule_self()"
From: |
Michael Tokarev |
Subject: |
[Stable-9.0.2 04/22] Revert "monitor: use aio_co_reschedule_self()" |
Date: |
Fri, 5 Jul 2024 00:00:34 +0300 |
From: Stefan Hajnoczi <stefanha@redhat.com>
Commit 1f25c172f837 ("monitor: use aio_co_reschedule_self()") was a code
cleanup that uses aio_co_reschedule_self() instead of open coding
coroutine rescheduling.
Bug RHEL-34618 was reported and Kevin Wolf <kwolf@redhat.com> identified
the root cause. I missed that aio_co_reschedule_self() ->
qemu_get_current_aio_context() only knows about
qemu_aio_context/IOThread AioContexts and not about iohandler_ctx. It
does not function correctly when going back from the iohandler_ctx to
qemu_aio_context.
Go back to open coding the AioContext transitions to avoid this bug.
This reverts commit 1f25c172f83704e350c0829438d832384084a74d.
Cc: qemu-stable@nongnu.org
Buglink: https://issues.redhat.com/browse/RHEL-34618
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240506190622.56095-2-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 719c6819ed9a9838520fa732f9861918dc693bda)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index f3488afeef..176b549473 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -212,7 +212,8 @@ QDict *coroutine_mixed_fn qmp_dispatch(const QmpCommandList
*cmds, QObject *requ
* executing the command handler so that it can make progress if it
* involves an AIO_WAIT_WHILE().
*/
- aio_co_reschedule_self(qemu_get_aio_context());
+ aio_co_schedule(qemu_get_aio_context(), qemu_coroutine_self());
+ qemu_coroutine_yield();
}
monitor_set_cur(qemu_coroutine_self(), cur_mon);
@@ -226,7 +227,9 @@ QDict *coroutine_mixed_fn qmp_dispatch(const QmpCommandList
*cmds, QObject *requ
* Move back to iohandler_ctx so that nested event loops for
* qemu_aio_context don't start new monitor commands.
*/
- aio_co_reschedule_self(iohandler_get_aio_context());
+ aio_co_schedule(iohandler_get_aio_context(),
+ qemu_coroutine_self());
+ qemu_coroutine_yield();
}
} else {
/*
--
2.39.2
- [Stable-9.0.2 00/22] Patch Round-up for stable 9.0.2, freeze on 2024-07-14, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 01/22] target/i386: fix size of EBP writeback in gen_enter(), Michael Tokarev, 2024/07/04
- [Stable-9.0.2 02/22] virtio-net: drop too short packets early, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 04/22] Revert "monitor: use aio_co_reschedule_self()",
Michael Tokarev <=
- [Stable-9.0.2 03/22] ui/gtk: Draw guest frame at refresh cycle, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 06/22] stdvga: fix screen blanking, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 07/22] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 05/22] hw/audio/virtio-snd: Always use little endian audio format, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 08/22] linux-user: Make TARGET_NR_setgroups affect only the current thread, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 09/22] target/sparc: use signed denominator in sdiv helper, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 10/22] tcg/loongarch64: Fix tcg_out_movi vs some pcrel pointers, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 12/22] tests: Update our CI to use CentOS Stream 9 instead of 8, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 11/22] migration: Fix file migration with fdset, Michael Tokarev, 2024/07/04
- [Stable-9.0.2 14/22] target/arm: Fix VCMLA Dd, Dn, Dm[idx], Michael Tokarev, 2024/07/04