Maor Lipchuk has uploaded a new change for review.

Change subject: core: Removing targetSnapshot parameter
......................................................................

core: Removing targetSnapshot parameter

There is no need to use targetSnapshot parameter in
RestoreAllSnapshotsCommand, this parameter is only used in the execute
phase once.

Change-Id: I7d95947d52180720d98f5d07dcacc13e17161f5e
https://bugzilla.redhat.com/970115
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreAllSnapshotsCommand.java
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/55/24055/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreAllSnapshotsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreAllSnapshotsCommand.java
index 2a05aa8..96b76b3 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreAllSnapshotsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestoreAllSnapshotsCommand.java
@@ -58,7 +58,6 @@
 public class RestoreAllSnapshotsCommand<T extends 
RestoreAllSnapshotsParameters> extends VmCommand<T> implements 
QuotaStorageDependent {
 
     private final Set<Guid> snapshotsToRemove = new HashSet<Guid>();
-    private Snapshot targetSnapshot;
     List<DiskImage> imagesToRestore = new ArrayList<>();
 
     /**
@@ -395,15 +394,13 @@
             return false;
         }
 
-        targetSnapshot = 
getSnapshotDao().get(getParameters().getDstSnapshotId());
-
         MultipleStorageDomainsValidator storageValidator = 
createStorageDomainValidator();
         if (!validate(storageValidator.allDomainsExistAndActive()) ||
                 !validate(storageValidator.allDomainsWithinThresholds()) ||
                 !performImagesChecks() ||
                 !validate(vmValidator.vmDown()) ||
                 // if the user choose to commit a snapshot - the vm cant have 
disk snapshots attached to other vms.
-                (targetSnapshot.getType() == SnapshotType.REGULAR && 
!validate(vmValidator.vmNotHavingDeviceSnapshotsAttachedToOtherVms(false)))) {
+                
(getSnapshotDao().get(getParameters().getDstSnapshotId()).getType() == 
SnapshotType.REGULAR && 
!validate(vmValidator.vmNotHavingDeviceSnapshotsAttachedToOtherVms(false)))) {
             return false;
         }
 


-- 
To view, visit http://gerrit.ovirt.org/24055
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d95947d52180720d98f5d07dcacc13e17161f5e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to