blkreplay: Run BH in coroutine’s AioContext
While it does not matter in which AioContext we run aio_co_wake() to continue an exactly-once-yielding coroutine, making this commit not strictly necessary, there is also no reason why the BH should run in any context but the request’s AioContext. Signed-off-by: Hanna Czenczek <hreitz@redhat.com> Message-ID: <20251110154854.151484-16-hreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
7c3e9b87f5
commit
b0cc742f84
1 changed files with 2 additions and 1 deletions
|
|
@ -63,9 +63,10 @@ static void block_request_create(uint64_t reqid, BlockDriverState *bs,
|
||||||
Coroutine *co)
|
Coroutine *co)
|
||||||
{
|
{
|
||||||
Request *req = g_new(Request, 1);
|
Request *req = g_new(Request, 1);
|
||||||
|
AioContext *ctx = qemu_coroutine_get_aio_context(co);
|
||||||
*req = (Request) {
|
*req = (Request) {
|
||||||
.co = co,
|
.co = co,
|
||||||
.bh = aio_bh_new(bdrv_get_aio_context(bs), blkreplay_bh_cb, req),
|
.bh = aio_bh_new(ctx, blkreplay_bh_cb, req),
|
||||||
};
|
};
|
||||||
replay_block_event(req->bh, reqid);
|
replay_block_event(req->bh, reqid);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue