Arik Hadas has uploaded a new change for review.

Change subject: core: change the order of checks in canDoAction of migrate vm
......................................................................

core: change the order of checks in canDoAction of migrate vm

Change the order in which the checks whether a snapshot is being taken
for the VM or whether one of its disks is locked are carried on, so that
the snapshot check will be made before, as in that case the disks of the
VM are also locked but this check produces a more specific can-do-action
error for the user.

Change-Id: I3e7cacc97fddd48e16564fda0911e7c9604fc731
Signed-off-by: Arik Hadas <aha...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/47/14247/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
index 305c8e9..453917e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
@@ -257,11 +257,10 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL);
         }
 
-        return
+        return validate(new 
SnapshotsValidator().vmNotDuringSnapshot(vm.getId()))
                 // This check was added to prevent migration of VM while its 
disks are being migrated
                 // TODO: replace it with a better solution
-                validate(new 
DiskImagesValidator(ImagesHandler.getPluggedImagesForVm(vm.getId())).diskImagesNotLocked())
-                && validate(new 
SnapshotsValidator().vmNotDuringSnapshot(vm.getId()))
+                && validate(new 
DiskImagesValidator(ImagesHandler.getPluggedImagesForVm(vm.getId())).diskImagesNotLocked())
                 && 
getVdsSelector().canFindVdsToRunOn(getReturnValue().getCanDoActionMessages(), 
true);
     }
 


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

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

Reply via email to