Skip to content

file-posix: Make truncate/preallocate asynchronous

Kevin Wolf qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 8 repliesIn review
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Add locking to qcow2_co_discard()
- Extra qcow2 fix and cleanup related to the locking code
- Use tracked requests infrastructure for serialising I/O requests against truncate in newly allocated areas

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6qcow2: Fix qcow2_truncate() error return valueblock/qcow2.c+1 -11 reply
2/6block: Convert .bdrv_truncate callback to coroutine_fnblock.c block/copy-on-read.c block/crypto.c +13 more+161 -891 reply
3/6qcow2: Remove coroutine trampoline for preallocate_co()block/qcow2.c+8 -431 reply
4/6block: Move bdrv_truncate() implementation to io.cblock.c block/io.c include/block/block_int.h+112 -1101 reply
5/6block: Use tracked request for truncateblock/io.c include/block/block_int.h+26 -01 reply
6/6file-posix: Make .bdrv_co_truncate asynchronousblock/file-posix.c include/block/raw-aio.h+153 -1161 reply

Reviews trailers per patch

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

PatchStefan Hajnoczi
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

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

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/6] file-posix: Make truncate/preallocate asynchronous

This fixes the problem that blockdev-create on a local file blocks the main loop despite being a background job. This was caused by file-posix preallocating the image with blocking syscalls rather than moving this to the thread pool and yielding the coroutine meanwhile.

v2:
- Add locking to qcow2_co_discard()
- Extra qcow2 fix and cleanup related to the locking code
- Use tracked requests infrastructure for serialising I/O requests against truncate in newly allocated areas

Kevin Wolf (6):
qcow2: Fix qcow2_truncate() error return value
block: Convert .bdrv_truncate callback to coroutine_fn
qcow2: Remove coroutine trampoline for preallocate_co()
block: Move bdrv_truncate() implementation to io.c
block: Use tracked request for truncate
file-posix: Make .bdrv_co_truncate asynchronous

 include/block/block.h     |   4 +
 include/block/block_int.h |   7 +-
 include/block/raw-aio.h   |   4 +-
 block.c                   |  64 +----------
 block/copy-on-read.c      |   8 +-
 block/crypto.c            |   9 +-
 block/file-posix.c        | 277 ++++++++++++++++++++++++++--------------------
 block/file-win32.c        |   6 +-
 block/gluster.c           |  14 ++-
 block/io.c                | 134 ++++++++++++++++++++++
 block/iscsi.c             |   8 +-
 block/nfs.c               |   7 +-
 block/qcow2.c             | 124 +++++++++------------
 block/qed.c               |   8 +-
 block/raw-format.c        |   8 +-
 block/rbd.c               |   8 +-
 block/sheepdog.c          |  12 +-
 block/ssh.c               |   6 +-
 18 files changed, 405 insertions(+), 303 deletions(-)
Signature · 1 line
2.13.6