Skip to content

qcow2: Let check -r all repair some snapshot bits

Max Reitz qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest16 patches 9 repliesIn review
  2. v216 patches 19 repliesSuperseded
  3. v113 patches 24 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16include: Move endof() up from hw/virtio/virtio.hhw/block/virtio-blk.c hw/net/virtio-net.c include/hw/virtio/virtio.h +1 more+14 -140 replies
2/16qcow2: Use endof()block/qcow2-snapshot.c+4 -30 replies
3/16qcow2: Add Error ** to qcow2_read_snapshots()block/qcow2-snapshot.c block/qcow2.c block/qcow2.h+8 -40 replies
4/16qcow2: Keep unknown extra snapshot datablock/qcow2-snapshot.c block/qcow2.h+56 -102 replies
5/16qcow2: Make qcow2_write_snapshots() publicblock/qcow2-snapshot.c block/qcow2.h+2 -10 replies
6/16qcow2: Put qcow2_upgrade() into its own functionblock/qcow2.c+38 -50 replies
7/16qcow2: Write v3-compliant snapshot list on upgradeblock/qcow2.c+30 -24 replies
8/16qcow2: Separate qcow2_check_read_snapshot_table()block/qcow2-snapshot.c block/qcow2.c block/qcow2.h+120 -180 replies
9/16qcow2: Add qcow2_check_fix_snapshot_table()block/qcow2-snapshot.c block/qcow2.c block/qcow2.h+36 -10 replies
10/16qcow2: Fix broken snapshot table entriesblock/qcow2-snapshot.c+56 -110 replies
11/16qcow2: Keep track of the snapshot table lengthblock/qcow2-snapshot.c+13 -10 replies
12/16qcow2: Fix overly long snapshot tablesblock/qcow2-snapshot.c+78 -100 replies
13/16qcow2: Repair snapshot table with too many entriesblock/qcow2-snapshot.c+14 -01 reply
14/16qcow2: Fix v3 snapshot table entry compliancyblock/qcow2-snapshot.c+18 -01 reply
15/16iotests: Add peek_file* functionstests/qemu-iotests/common.rc+20 -00 replies
16/16iotests: Test qcow2's snapshot table handlingtests/qemu-iotests/261 tests/qemu-iotests/261.out tests/qemu-iotests/group+870 -00 replies

Reviews trailers per patch

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

PatchEric Blake
1/16R-b
2/16R-b
3/16R-b
4/16R-b
5/16R-b
6/16R-b
7/16R-b
8/16R-b
9/16R-b
10/16R-b
11/16R-b
12/16R-b
13/16R-b
14/16R-b
15/16R-b
16/16R-b

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

Read the v3 thread

Cover letter [PATCH v3 00/16] qcow2: Let check -r all repair some snapshot bits

Hi,

The v1 cover letter explained this series’s purpose:
https://lists.nongnu.org/archive/html/qemu-block/2019-07/msg01290.html

The v2 cover letter explained the v2 changes:
https://lists.nongnu.org/archive/html/qemu-block/2019-08/msg00921.html

The only changes in v3 are:
- Patches 12 and 13: Added notes to the commit messages why it’s OK to not let the user choose which snapshots to drop

(I wanted to also address Eric’s idea of letting QCowSnapshot.extra_data_size be always >= sizeof(QCowSnapshotExtraData) and thus save the MAX(sizeof(extra), sn->extra_data_size) in qcow2_write_snapshots(), but that doesn’t really work, because then we have no way of knowing later whether the image is compliant and thus needs fixing or not. He gave me an R-b anyway, so I guess it’s fine. O:-))

This series now has R-bs from Eric on all patches. I’m only posting it because I felt a bit bad about just taking the series as-is and add the commit notes to 12 and 13 while applying it.
(Also, maybe there is someone who saw me have a bit of discussion with Eric and thus assumed I would definitely send a v3 that they could then review.)

Max Reitz (16):
include: Move endof() up from hw/virtio/virtio.h
qcow2: Use endof()
qcow2: Add Error ** to qcow2_read_snapshots()
qcow2: Keep unknown extra snapshot data
qcow2: Make qcow2_write_snapshots() public
qcow2: Put qcow2_upgrade() into its own function
qcow2: Write v3-compliant snapshot list on upgrade
qcow2: Separate qcow2_check_read_snapshot_table()
qcow2: Add qcow2_check_fix_snapshot_table()
qcow2: Fix broken snapshot table entries
qcow2: Keep track of the snapshot table length
qcow2: Fix overly long snapshot tables
qcow2: Repair snapshot table with too many entries
qcow2: Fix v3 snapshot table entry compliancy
iotests: Add peek_file* functions
iotests: Test qcow2's snapshot table handling

 block/qcow2.h                |  15 +-
 include/hw/virtio/virtio.h   |   7 -
 include/qemu/compiler.h      |   7 +
 block/qcow2-snapshot.c       | 323 +++++++++++++++++++--
 block/qcow2.c                | 155 +++++++++--
 hw/block/virtio-blk.c        |   4 +-
 hw/net/virtio-net.c          |  10 +-
 tests/qemu-iotests/261       | 523 +++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/261.out   | 346 +++++++++++++++++++++++
 tests/qemu-iotests/common.rc |  20 ++
 tests/qemu-iotests/group     |   1 +
 11 files changed, 1354 insertions(+), 57 deletions(-)
 create mode 100755 tests/qemu-iotests/261
 create mode 100644 tests/qemu-iotests/261.out
Signature · 1 line
2.21.0