]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_snapshot: when deleting snapshot invalidate parent snapshot
authorPavel Hrdina <phrdina@redhat.com>
Mon, 5 Dec 2022 12:03:32 +0000 (13:03 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 9 Jan 2023 12:33:07 +0000 (13:33 +0100)
commit565bcb5d79dddaf1d0d14cffe1f3ae78d76b10a0
tree198b54b58ef29ccbc08d8c9807eae45afd6d6a70
parent7190582fbc2bb3b3c95c76acce41b49687de1053
qemu_snapshot: when deleting snapshot invalidate parent snapshot

When deleting external snapshots the operation may fail at any point
which could lead to situation that some disks finished the block commit
operation but for some disks it failed and the libvirt job ends.

In order to make sure that the qcow2 images are in consistent state
introduce new element "<snapshotDeleteInProgress/>" that will mark the
disk in snapshot metadata as invalid until the snapshot delete is
completed successfully.

This will prevent deleting snapshot with the invalid disk and in future
reverting to snapshot with the invalid disk.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/snapshot_conf.c
src/conf/snapshot_conf.h
src/qemu/qemu_snapshot.c