Liron Ar has uploaded a new change for review.

Change subject: core: further handling of unmanaged disk devices
......................................................................

core: further handling of unmanaged disk devices

When attempting to restore vm configuration from a snapshot, unmanaged
disk devices can be removed as well and restored from the snapshot if
needed like other unmanaged devices.

Change-Id: Ia0cd3a95de9b04d49cc655981e15abed4f1adab7
Related-To: https://bugzilla.redhat.com/show_bug.cgi?id=1032807
Signed-off-by: Liron Aravot <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java
1 file changed, 2 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/02/21802/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java
index e8185d5..6229815 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java
@@ -342,16 +342,11 @@
      * of the snapshot. Other disks shouldn't be removed as they are not part 
of the snapshot).
      */
     private boolean deviceCanBeRemoved(VmDevice vmDevice) {
-        if (!vmDevice.getDevice().equals(VmDeviceType.DISK.getName())) {
+        if (!vmDevice.getDevice().equals(VmDeviceType.DISK.getName()) || 
!vmDevice.getIsManaged()) {
             return true;
         }
 
-        if (vmDevice.getSnapshotId() == null) {
-           Disk disk = getDiskDao().get(vmDevice.getDeviceId());
-           return disk != null && disk.isAllowSnapshot();
-        }
-
-        return false;
+        return vmDevice.getSnapshotId() == null && 
getDiskDao().get(vmDevice.getDeviceId()).isAllowSnapshot();
     }
 
     /**


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

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

Reply via email to