mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemu_snapshot: check only once if snapshot is external
There will be more external snapshot checks introduced by following patch so group them together. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
32cf4ed5cd
commit
daf48171f1
@ -3728,19 +3728,19 @@ qemuSnapshotDeleteValidate(virDomainObj *vm,
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainSnapshotIsExternal(snap) &&
|
||||
qemuDomainHasBlockjob(vm, false)) {
|
||||
if (virDomainSnapshotIsExternal(snap)) {
|
||||
if (qemuDomainHasBlockjob(vm, false)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot delete external snapshots when there is another active block job"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virDomainSnapshotIsExternal(snap) &&
|
||||
(flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN)) {
|
||||
if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("deletion of external disk snapshots with children not supported"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user