On Tue, Mar 31, 2020 at 12:06:15PM +0200, Peter Krempa wrote:
On Tue, Mar 31, 2020 at 11:18:29 +0200, Pavel Mores wrote:
> + }
> +
> + if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN)
> + topPath = disk->src->path;
> + else
> + topPath = snapdisk->src->path;
You must not use paths for doing this lookup. Paths at best work for
local files only and this would make the code not future proof.
Also you want to verify that:
- images you want to merge are actually in the backing chain
- the backing chain looks as snapshots describe it (e.g you unplug vda
and plug a different chain back)
Doing the validation above will necessarily give you a
virStorageSourcePtr for the appropriate member of the backing chain and
that one should be used as argument for the commit operation.
I'm afraid I'm not following this. qemuDomainBlockCommitImpl(), just like
qemuDomainBlockCommit() take paths so that's what I'm passing them. What do
you mean, I should use virStorageSourcePtr as argument for the commit
operation?
pvl