Skip to content

qcow2: Improve refcount structure rebuilding

Max Reitz qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4qcow2: Improve refcount structure rebuildingblock/qcow2-refcount.c+67 -593 replies
2/4iotests/common.qemu: Add _cleanup_single_qemutests/qemu-iotests/common.qemu+34 -210 replies
3/4iotests/common.qemu: Allow using the QSDtests/qemu-iotests/common.qemu+43 -100 replies
4/4iotests/108: Test new refcount rebuild algorithmtests/qemu-iotests/108 tests/qemu-iotests/108.out+339 -01 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/4] qcow2: Improve refcount structure rebuilding

Hi,

When the qcow2 refcount structure is broken to a point where we cannot rely on any information from it (because it shows clusters as free that are in use), “qemu-img check -r all” completely rewrites it.

The new reftable is preferably written into the area covered by the last refblock for the image, but if that refblock is empty (e.g. because the image is on a block device and there is just nothing near the end of the block device), then the reftable will be put after the image’s end. Which is a problem on block devices, because they can’t easily be resized (also, resizing wouldn’t really help in this case, because the reftable would still be written past the new end).

So patch 1 modifies the algorithm to put the reftable into the first free space in the image, and patch 4 adds a test. So that we can make patch 4 a bit nicer, patches 2 and 3 are included. (In case you don’t like anything about 2 or 3, I also have a version of this series without patches 2 and 3, where 4 is correspondingly unnicer.)

Max Reitz (4):
qcow2: Improve refcount structure rebuilding iotests/common.qemu: Add _cleanup_single_qemu iotests/common.qemu: Allow using the QSD iotests/108: Test new refcount rebuild algorithm

 block/qcow2-refcount.c         | 126 ++++++++--------
 tests/qemu-iotests/108         | 259 +++++++++++++++++++++++++++++++++
 tests/qemu-iotests/108.out     |  80 ++++++++++
 tests/qemu-iotests/common.qemu | 108 ++++++++++----
 4 files changed, 483 insertions(+), 90 deletions(-)
Signature · 1 line
2.29.2