mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: snapshot: Unify conditions checking whether snapshot needs to be taken
In the cleanup path we already checked whether a snapshot needed to be taken by looking into the collected data. Use the same approach when creating the snapshot command data and when committing the changes to the domain definition. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d5d02aa900
commit
c5dc734403
@ -15015,7 +15015,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
||||
* VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL with a valid file name and
|
||||
* qcow2 format. */
|
||||
for (i = 0; i < snap->def->ndisks; i++) {
|
||||
if (snap->def->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)
|
||||
if (!diskdata[i].src)
|
||||
continue;
|
||||
|
||||
ret = qemuDomainSnapshotCreateSingleDiskActive(driver, vm,
|
||||
@ -15039,8 +15039,14 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
||||
goto error;
|
||||
}
|
||||
|
||||
for (i = 0; i < snap->def->ndisks; i++)
|
||||
qemuDomainSnapshotUpdateDiskSources(&diskdata[i], &persist);
|
||||
for (i = 0; i < snap->def->ndisks; i++) {
|
||||
qemuDomainSnapshotDiskDataPtr dd = &diskdata[i];
|
||||
|
||||
if (!dd->src)
|
||||
continue;
|
||||
|
||||
qemuDomainSnapshotUpdateDiskSources(dd, &persist);
|
||||
}
|
||||
}
|
||||
|
||||
error:
|
||||
|
Loading…
x
Reference in New Issue
Block a user