On 7/30/19 12:25 PM, Max Reitz wrote: > 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 > --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org