]> git.proxmox.com Git - mirror_qemu.git/commit
qcow2: Fix overly long snapshot tables
authorMax Reitz <mreitz@redhat.com>
Fri, 11 Oct 2019 15:28:10 +0000 (17:28 +0200)
committerMax Reitz <mreitz@redhat.com>
Mon, 28 Oct 2019 10:54:04 +0000 (11:54 +0100)
commit099febf3ac37e8d615e90066e515dd9b1d9bba52
tree95f9d3045565458a3d76c629b66accbee2c38e2d
parent624143355cb6e4149ec27b9b00088aeb958da31d
qcow2: Fix overly long snapshot tables

We currently refuse to open qcow2 images with overly long snapshot
tables.  This patch makes qemu-img check -r all drop all offending
entries past what we deem acceptable.

The user cannot choose which snapshots are removed.  This is fine
because we have chosen the maximum snapshot table size to be so large
(64 MB) that it cannot be reasonably reached.  If the snapshot table
exceeds this size, the image has probably been corrupted in some way; in
this case, it is most important to just make the image usable such that
the user can copy off at least the active layer.
(Also note that the snapshots will be removed only with "-r all", so a
plain "check" or "check -r leaks" will not delete any data.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20191011152814.14791-13-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-snapshot.c