]> xenbits.xensource.com Git - libvirt.git/commit
qemu_snapshot: implement deletion of external snapshot
authorPavel Hrdina <phrdina@redhat.com>
Thu, 15 Dec 2022 14:50:47 +0000 (15:50 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 9 Jan 2023 12:33:05 +0000 (13:33 +0100)
commite27f08196710d3f565eb879a6f271a29a0ec00fe
tree36b34160cca52643cfd7f8a7b0ad52325f855077
parent4a4d89a92522de7dbab0f99a571ff2e565be24e0
qemu_snapshot: implement deletion of external snapshot

When deleting snapshot we are starting block-commit job over all disks
that are part of the snapshot.

This operation may fail as it writes data changes to the backing qcow2
image so we need to wait for all the disks to finish the operation and
wait for correct signal from QEMU. If deleting active snapshot we will
get `ready` signal and for inactive snapshots we need to disable
autofinalize in order to get `pending` signal.

At this point if commit for any disk fails for some reason and we abort
the VM is still in consistent state and user can fix the reason why the
deletion failed.

After that we do `pivot` or `finalize` if it's active snapshot or not to
finish the block job. It still may fail but there is nothing else we can
do about it.

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