]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuDomainSnapshotForEachQcow2: Pass in 'def' rather than selecting it internally
authorPeter Krempa <pkrempa@redhat.com>
Mon, 23 Nov 2020 10:13:19 +0000 (11:13 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 24 Nov 2020 16:59:26 +0000 (17:59 +0100)
commit926563dc3a6c3f1598c5a54626acf31b7d3a6043
tree4ae55c6b6192f2b61cbea156e11c478c721e5dd7
parentd3c6c80c79eba3125eb2af0f187c8018c124c640
qemuDomainSnapshotForEachQcow2: Pass in 'def' rather than selecting it internally

In some cases such as when creating an internal inactive snapshot we
know that the domain definition in the snapshot is equivalent to the
current definition. Additionally we set up the current definition for
the snapshotting but not the one contained in the snapshot. Thus in some
cases the caller knows better which def to use.

Make qemuDomainSnapshotForEachQcow2 take the definition by the caller
and copy the logic for selecting the definition to callers where we
don't know for sure that the above claim applies.

This fixes internal inactive snapshots when <disk type='volume'> is used
as we translate the pool/vol combo only in the current def.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/97
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_snapshot.c