Skip to content

RFC qemu-img convert: Fix sparseness detection

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iotests: Test qemu-img convert of zeroed data clustertests/qemu-iotests/122 tests/qemu-iotests/122.out+9 -20 replies
2/2qemu-img convert: Fix sparseness detectionqemu-img.c tests/qemu-iotests/122.out+8 -229 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/2] qemu-img convert: Fix sparseness detection

Peter, three years ago you changed 'qemu-img convert' to sacrifice some sparsification in order to get aligned requests on the target image. At the time, I thought the impact would be small, but it turns out that this can end up wasting gigabytes of storagee (like converting a fully zeroed 10 GB image taking 2.8 GB instead of a few kilobytes).

https://bugzilla.redhat.com/show_bug.cgi?id=1882917

I'm not entirely sure how to attack this best since this is a tradeoff, but maybe the approach in this series is still good enough for the case that you wanted to fix back then?

Of course, it would be possible to have a more complete fix like looking forward a few blocks more before writing data, but that would probably not be entirely trivial because you would have to merge blocks with ZERO block status with DATA blocks that contain only zeros. I'm not sure if it's worth this complication of the code.

Kevin Wolf (2):
iotests: Test qemu-img convert of zeroed data cluster qemu-img convert: Fix sparseness detection

 qemu-img.c                 | 18 ++++--------------
 tests/qemu-iotests/122     |  1 +
 tests/qemu-iotests/122.out |  6 ++++--
 3 files changed, 9 insertions(+), 16 deletions(-)
Signature · 1 line
2.30.2