Skip to content

qcow2: Patch for shrinking qcow2 disk image

Jun Li qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 12 repliesIn review
  2. v42 patches 2 repliesSuperseded
  3. v32 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v21 patch2 repliesSuperseded
v11 patch0 repliesSuperseded

Changes in v5 from the cover letter

Add qemu-iotests for qcow2 shrinking. Do some modifications based on MAX's suggestions in v4.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3qcow2: Add qcow2_shrink_l1_and_l2_table for qcow2 shrinkingblock/qcow2-cluster.c block/qcow2.c block/qcow2.h+218 -37 replies
2/3qcow2: add update refcount table realization for update_refcountblock/qcow2-refcount.c+48 -12 replies
3/3qcow2: Add qemu-iotests for qcow2 shrinkingtests/qemu-iotests/110 tests/qemu-iotests/110.out tests/qemu-iotests/group+90 -01 reply

Reviews trailers per patch

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

Read the v5 thread

Cover letter [Qemu-devel] [PATCH v5 0/3] qcow2: Patch for shrinking qcow2 disk image

v5:
Add qemu-iotests for qcow2 shrinking. Do some modifications based on MAX's suggestions in v4.

v4:
Add deal with COW clusters in l2 table. When using COW, some of (l2_entry >>
s->cluster_bits) will larger than s->refcount_table_size, so need to discard this l2_entry.

v3:
Fixed host cluster leak.

In file block/qcow2.c, just using ftruncate to fix host cluster leak.

In file block/qcow2-cluster.c, just re-copy qcow2_grow_l1_table to realize qcow2_shrink_l1_and_l2_table.

In file block/qcow2-refcount.c, also update the realization to handle self-describing refcount blocks in function update_refcount.

Thanks.

Jun Li (3):
qcow2: Add qcow2_shrink_l1_and_l2_table for qcow2 shrinking
qcow2: add update refcount table realization for update_refcount
qcow2: Add qemu-iotests for qcow2 shrinking

 block/qcow2-cluster.c      | 182 +++++++++++++++++++++++++++++++++++++++++++++
 block/qcow2-refcount.c     |  49 +++++++++++-
 block/qcow2.c              |  37 ++++++++-
 block/qcow2.h              |   2 +
 tests/qemu-iotests/110     |  76 +++++++++++++++++++
 tests/qemu-iotests/110.out |  13 ++++
 tests/qemu-iotests/group   |   1 +
 7 files changed, 356 insertions(+), 4 deletions(-)
 create mode 100755 tests/qemu-iotests/110
 create mode 100644 tests/qemu-iotests/110.out
Signature · 1 line
1.9.3