Am 30.09.2026 um 18:49 hat Denis V. Lunev geschrieben:
> From: Denis V. Lunev <[email protected]>
> 
> A request that stops at a breakpoint belongs to whichever AioContext
> issued it, and the monitor or qemu-io that resumes it runs somewhere
> else. Two things go wrong once those are not the same thread.
> 
> resume_req_by_tag() woke the request with qemu_coroutine_enter(), which
> enters the coroutine on the caller's thread. That moves the request off
> its own thread for the rest of its life, and it aborts outright when it
> wins the race against the yield, because the request is published to
> the list before the coroutine gets there.
> 
> wait_break polled the block backend's AioContext, where the event will
> never arrive, so it slept through the suspension it was waiting for.
> 
> Wake the request in the context it came from and wait for it the way
> the rest of the block layer waits across contexts. Where the two
> contexts are the same the coroutine is still entered directly, so
> single-threaded behaviour, and the output tests depending on it, do not
> change.
> 
> Signed-off-by: Denis V. Lunev <[email protected]>
> CC: Kevin Wolf <[email protected]>
> CC: Hanna Reitz <[email protected]>
> CC: Vladimir Sementsov-Ogievskiy <[email protected]>
> CC: Andrey Drobyshev <[email protected]>

Maybe order this one before the patch that lets qemu-io start requests
in iothreads? In practice, this is what exposes the problem. (Though
yes, theoretically you could provoke it in other ways, too.)

>  block/blkdebug.c | 3 ++-
>  qemu-io-cmds.c   | 5 ++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/block/blkdebug.c b/block/blkdebug.c
> index 78cc03746f..1522015b34 100644
> --- a/block/blkdebug.c
> +++ b/block/blkdebug.c
> @@ -813,6 +813,7 @@ static void suspend_request(BlockDriverState *bs, 
> BlkdebugRule *rule)
>  
>      remove_rule(rule);
>      QLIST_INSERT_HEAD(&s->suspended_reqs, r, next);
> +    aio_wait_kick();

Could this use a comment to tell that this wakes up the 'wait_break'
command in qemu-io?

Kevin


Reply via email to