Skip to content

block-backend: Use coroutine for flush/discard/ioctl

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9block: Use blk_co_flush() for all BB level flushesblock/block-backend.c+17 -101 reply
2/9block: Use blk_co_pdiscard() for all BB level discardblock/block-backend.c+18 -121 reply
3/9block: Remove bdrv_aio_pdiscard()block/io.c block/trace-events include/block/block.h+0 -333 replies
4/9block: Use blk_co_ioctl() for all BB level ioctlsblock/block-backend.c block/io.c include/block/block.h +1 more+39 -101 reply
5/9raw-posix: Don't use bdrv_ioctl()block/raw-posix.c+13 -31 reply
6/9block: Remove bdrv_ioctl()block/io.c include/block/block.h+0 -381 reply
7/9block: Introduce .bdrv_co_ioctl() driver callbackblock/io.c include/block/block_int.h+12 -61 reply
8/9raw: Implement .bdrv_co_ioctl instead of .bdrv_aio_ioctlblock/raw_bsd.c+3 -61 reply
9/9block: Remove bdrv_aio_ioctl()block/io.c include/block/block.h+0 -301 reply

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-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 [Qemu-devel] [PATCH 0/9] block-backend: Use coroutine for flush/discard/ioctl

Paolo, this is my attempt at implementing what you were asking for last Friday. I converted blk_(co_)flush/pdiscard/ioctl so that all interfaces (coroutine, AIO, sync) go through the same coroutine-based function already on the BlockBackend level. Where it was reasonably easy, I also removed the corresponding emulations from block/io.c IIUC, this should cover your immediate needs.

Function to remove this series leaves for another day:

* bdrv_aio_flush (used by blkdebug, blkverify, qed)
* bdrv_flush (even more users)
* bdrv_pdiscard (used by qcow2)

BlockDriver callbacks to remove left for another day:

* bdrv_aio_pdiscard (implemented by raw-posix and rbd)
* bdrv_aio_ioctl (implemented by raw-posix and iscsi)

In both cases, raw-posix is trivial to covert, but iscsi and rbd feel rather scary without a proper test setup.

Kevin Wolf (9):
block: Use blk_co_flush() for all BB level flushes
block: Use blk_co_pdiscard() for all BB level discard
block: Remove bdrv_aio_pdiscard()
block: Use blk_co_ioctl() for all BB level ioctls
raw-posix: Don't use bdrv_ioctl()
block: Remove bdrv_ioctl()
block: Introduce .bdrv_co_ioctl() driver callback

  raw: Implement .bdrv_co_ioctl instead of .bdrv_aio_ioctl
  block: Remove bdrv_aio_ioctl()
 block/block-backend.c          |  94 ++++++++++++++++++++++++----------
 block/io.c                     | 111 ++++-------------------------------------
 block/raw-posix.c              |  16 ++++--
 block/raw_bsd.c                |   9 ++--
 block/trace-events             |   1 -
 include/block/block.h          |   8 +--
 include/block/block_int.h      |   2 +
 include/sysemu/block-backend.h |   1 +
 8 files changed, 98 insertions(+), 144 deletions(-)
Signature · 1 line
1.8.3.1