From: Kevin Wolf Date: Tue, 28 Jan 2020 15:06:41 +0000 (+0100) Subject: mirror: Store MirrorOp.co for debuggability X-Git-Tag: v5.0.0-rc0~85^2~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eed325b92c3e68417121ea23f96e33af6a4654ed;p=thirdparty%2Fqemu.git mirror: Store MirrorOp.co for debuggability If a coroutine is launched, but the coroutine pointer isn't stored anywhere, debugging any problems inside the coroutine is quite hard. Let's store the coroutine pointer of a mirror operation in MirrorOp to have it available in the debugger. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- diff --git a/block/mirror.c b/block/mirror.c index f0f2d9dff15..8959e4255ff 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -103,6 +103,7 @@ struct MirrorOp { bool is_pseudo_op; bool is_active_write; CoQueue waiting_requests; + Coroutine *co; QTAILQ_ENTRY(MirrorOp) next; }; @@ -429,6 +430,7 @@ static unsigned mirror_perform(MirrorBlockJob *s, int64_t offset, default: abort(); } + op->co = co; QTAILQ_INSERT_TAIL(&s->ops_in_flight, op, next); qemu_coroutine_enter(co);