Liron Ar has uploaded a new change for review. Change subject: core: SnapshotManage - disk devices might not represent engine disks ......................................................................
core: SnapshotManage - disk devices might not represent engine disks When using the snapshot manager there is an attempt to remove the disks that aren't part of the snaposhot. That's being done by loading the vm disk devices, load the disk for each device and remove it if needed. If the device represented disk isn't a disk known by the engine, do not remove it (as being done for disks that aren't snappable/snapshot disks). Note - This method could be refactored to load the vm disks directly instead of the devices and then the disks. In this patch i the null check would be added, while further refactor would be done in follow up change. Change-Id: Ie38c39c0f0409988a73610fe1dfb9a22afee5553 Bug-Url: 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, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/80/21580/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 e946187..6be76c1 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 @@ -513,7 +513,7 @@ vmId, VmDeviceGeneralType.DISK, VmDeviceType.DISK.getName())) { if (!diskIdsFromSnapshot.contains(vmDevice.getDeviceId()) && vmDevice.getSnapshotId() == null) { Disk disk = getDiskDao().get(vmDevice.getDeviceId()); - if (disk.isAllowSnapshot()) { + if (disk != null && disk.isAllowSnapshot()) { getBaseDiskDao().remove(vmDevice.getDeviceId()); getVmDeviceDao().remove(vmDevice.getId()); } -- To view, visit http://gerrit.ovirt.org/21580 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie38c39c0f0409988a73610fe1dfb9a22afee5553 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
