mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-07 18:35:46 +00:00
qemu_snapshot: prepare data for non-active leaf external snapshot deletion
In this case there is no need to run block commit and using qemu process at all. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
a3152a506b
commit
d84538fbad
@ -2759,6 +2759,14 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Leaf non-active snapshot doesn't have overlay files for the disk images
|
||||
* so there is no need to do any merge and we can just delete the files
|
||||
* directly. */
|
||||
if (snap != virDomainSnapshotGetCurrent(vm->snapshots) &&
|
||||
snap->nchildren == 0) {
|
||||
if (qemuSnapshotDeleteExternalPrepareData(vm, snap, false, externalData) < 0)
|
||||
return -1;
|
||||
} else {
|
||||
/* this also serves as validation whether the snapshot can be deleted */
|
||||
if (qemuSnapshotDeleteExternalPrepareData(vm, snap, true, &tmpData) < 0)
|
||||
return -1;
|
||||
@ -2788,6 +2796,7 @@ qemuSnapshotDeleteExternalPrepare(virDomainObj *vm,
|
||||
|
||||
qemuDomainSaveStatus(vm);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user