Skip to content

RFC block: Synchronous bdrv_*() from coroutine in different AioContext

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: Factor out bdrv_run_co()block/io.c+28 -763 replies
2/3block: Allow bdrv_run_co() from different AioContextblock/io.c+14 -16 replies
3/3block: Assert we're running in the right threadblock/io.c+4 -13 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchEric BlakePhilippe Mathieu-Daudé
1/3R-b R-b
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/3] block: Synchronous bdrv_*() from coroutine in different AioContext

Stefan (Reiter), after looking a bit closer at this, I think there is no bug in QEMU, but the bug is in your coroutine code that calls block layer functions without moving into the right AioContext first. I've written this series anyway as it potentially makes the life of callers easier and would probably make your buggy code correct.

However, it doesn't feel right to commit something like patch 2 without having a user for it. Is there a reason why you can't upstream your async snapshot code?

The series would also happen fix a bug in my recent patch to convert qmp_block_resize() to coroutines, but I feel it's not how I would naturally fix it. Switching the thread already in the QMP handler before calling bdrv_truncate() would feel more appropriate. I wonder if it wouldn't actually be the same for your snapshot code.

Kevin Wolf (3):
block: Factor out bdrv_run_co()
block: Allow bdrv_run_co() from different AioContext
block: Assert we're running in the right thread

 block/io.c | 122 ++++++++++++++++++++---------------------------------
 1 file changed, 45 insertions(+), 77 deletions(-)
Signature · 1 line
2.25.3