]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2.h
qcow2: Add qcow2_check_fix_snapshot_table()
authorMax Reitz <mreitz@redhat.com>
Fri, 11 Oct 2019 15:28:07 +0000 (17:28 +0200)
committerMax Reitz <mreitz@redhat.com>
Mon, 28 Oct 2019 10:54:01 +0000 (11:54 +0100)
commitfe446b5da225b551fc6493890d437fe4a8ba7552
tree505c146a14f09c52e90ae56aba4835cbf300b3d8
parent8bc584fe035d98b8aca4fcc818617c91df0ed925
qcow2: Add qcow2_check_fix_snapshot_table()

qcow2_check_read_snapshot_table() can perform consistency checks, but it
cannot fix everything.  Specifically, it cannot allocate new clusters,
because that should wait until the refcount structures are known to be
consistent (i.e., after qcow2_check_refcounts()).  Thus, it cannot call
qcow2_write_snapshots().

Do that in qcow2_check_fix_snapshot_table(), which is called after
qcow2_check_refcounts().

Currently, there is nothing that would set result->corruptions, so this
is a no-op.  A follow-up patch will change that.

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