Arik Hadas has uploaded a new change for review.

Change subject: core: fix removing snapshot's memory on remove vm
......................................................................

core: fix removing snapshot's memory on remove vm

On remove VM, the memory volumes in snapshots are removed after the
snapshots of the VM are removed, so the memory volumes should be
removed if no other snapshot use them (instead of checking whether
there's one snapshot that use them).

Change-Id: I500d1abb1b040887a595a58f1797eb19b82189db
Bug-Url: https://bugzilla.redhat.com/960931
Signed-off-by: Arik Hadas <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmCommand.java
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/92/16092/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmCommand.java
index cb6539d..7c4c46d 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmCommand.java
@@ -68,6 +68,12 @@
         setSucceeded(removeVm());
     }
 
+    @Override
+    protected boolean shouldRemoveMemorySnapshotVolumes(String memoryVolume) {
+        return !memoryVolume.isEmpty() &&
+                
getDbFacade().getSnapshotDao().getNumOfSnapshotsByMemory(memoryVolume) == 0;
+    }
+
     private boolean removeVm() {
         final List<DiskImage> diskImages = 
ImagesHandler.filterImageDisks(getVm().getDiskList(),
                 true,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I500d1abb1b040887a595a58f1797eb19b82189db
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to