Liron Ar has uploaded a new change for review. Change subject: core: do not allow to perform preview when the vm has illegal disks ......................................................................
core: do not allow to perform preview when the vm has illegal disks When attempting to preview vm - do not allow to perform it when the vm has illegal disks. general: I think that it makes more sense to perform all of the checks on disks that are part of the snapshot and not all the vm disks, it should be taken care of in a further patch. Change-Id: I8ee0e8070fb91bd2e0f18cf7bdb7a44aa51f70af Bug-Url: https://bugzilla.redhat.com/949624 Signed-off-by: Liron Aravot <lara...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TryBackToAllSnapshotsOfVmCommand.java 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/96/13896/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TryBackToAllSnapshotsOfVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TryBackToAllSnapshotsOfVmCommand.java index d5fcb28..7adbcd7 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TryBackToAllSnapshotsOfVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/TryBackToAllSnapshotsOfVmCommand.java @@ -212,11 +212,18 @@ } updateVmDisksFromDb(); - Collection<DiskImage> diskImages = + List<DiskImage> diskImages = ImagesHandler.filterImageDisks(getVm().getDiskMap().values(), false, true); if (!diskImages.isEmpty()) { - if (!validate(new StoragePoolValidator(getStoragePool()).isUp()) - || !ImagesHandler.PerformImagesChecks( + if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { + return false; + } + + if (!ImagesHandler.checkImagesIllegal(getReturnValue().getCanDoActionMessages(), diskImages)) { + return false; + } + + if(!ImagesHandler.PerformImagesChecks( getReturnValue().getCanDoActionMessages(), getVm().getStoragePoolId(), Guid.Empty, -- To view, visit http://gerrit.ovirt.org/13896 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ee0e8070fb91bd2e0f18cf7bdb7a44aa51f70af Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <lara...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches