]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_snapshot: refactor validation of snapshot delete
authorPavel Hrdina <phrdina@redhat.com>
Tue, 23 Aug 2022 11:18:35 +0000 (13:18 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 9 Jan 2023 12:32:59 +0000 (13:32 +0100)
commit4475c69787d8b06b61e0521142720e6a17cee457
tree097ca5b75e8d66c33b846b36720500188e311601
parent86883588c7fee6cc15b903fe426459b25dadcffe
qemu_snapshot: refactor validation of snapshot delete

Prepare the validation function for external snapshot delete support.

There is one exception when deleting `children-only` snapshots. If the
snapshot tree is like this example:

    snap1 (external)
     |
     +- snap2 (internal)
         |
         +- snap3 (internal)
             |
             +- snap4 (internal)

and user calls `snapshot-delete snap1 --children-only` the current
snapshot is external but all the children snapshots are internal only
and we are able to delete it.

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