Skip to content

qemu-img: support compression regardless of cluster size

Stefan Hajnoczi qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyIn review
  2. v14 patches 4 repliesApplied

Changes in v2 from the cover letter

* Extend test case to check virtual disk size and contents [eblake]
* Note: only the last commit changed

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4qcow2: allow sub-cluster compressed write to last clusterblock/qcow2.c+15 -20 replies
2/4qcow: allow sub-cluster compressed write to last clusterblock/qcow.c+15 -20 replies
3/4qemu-img: do not zero-pad the compressed write bufferqemu-img.c+2 -60 replies
4/4qemu-iotests: add 053 unaligned compressed image size testtests/qemu-iotests/053 tests/qemu-iotests/053.out tests/qemu-iotests/group+91 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/4] qemu-img: support compression regardless of cluster size

It was hard to find a short email subject line. Anyway, the problem is that qemu-img convert -c fails with the following error message if the input image length is not a multiple of the output cluster size:

qemu-img: error while compressing sector 0: Input/output error

Ilkka Tengvall <[email protected]> reported the failure. kwolf and eblake suggested a fix which this patch series implements.

qemu-img convert -c succeeds with these patches applied.

The final patch adds qemu-iotests case 053 to protect against regressions.

v2:
* Extend test case to check virtual disk size and contents [eblake]
* Note: only the last commit changed

Stefan Hajnoczi (4):
qcow2: allow sub-cluster compressed write to last cluster
qcow: allow sub-cluster compressed write to last cluster
qemu-img: do not zero-pad the compressed write buffer
qemu-iotests: add 053 unaligned compressed image size test

 block/qcow.c               | 17 +++++++++--
 block/qcow2.c              | 17 +++++++++--
 qemu-img.c                 |  8 ++---
 tests/qemu-iotests/053     | 73 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/053.out | 17 +++++++++++
 tests/qemu-iotests/group   |  1 +
 6 files changed, 123 insertions(+), 10 deletions(-)
 create mode 100755 tests/qemu-iotests/053
 create mode 100644 tests/qemu-iotests/053.out
Signature · 1 line
1.8.1.4