On Thu, Jan 05, 2023 at 12:47:01 +0100, Pavel Hrdina wrote: > 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@xxxxxxxxxx> > --- > src/qemu/qemu_snapshot.c | 256 ++++++++++++++++++++++++++++++++++++--- > 1 file changed, 236 insertions(+), 20 deletions(-) Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>