There will be more external snapshot checks introduced by following
patch so group them together.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 8d0581d33b..dca95b415b 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -3728,18 +3728,18 @@ qemuSnapshotDeleteValidate(virDomainObj *vm,
}
}
- if (virDomainSnapshotIsExternal(snap) &&
- 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)) {
+ 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)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("deletion of external disk snapshots with children not
supported"));
- return -1;
+ 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;
--
2.41.0