Eldan Shachar has uploaded a new change for review.

Change subject: core: Remove validations when running suspended VM
......................................................................

core: Remove validations when running suspended VM

Remove unneeded parts from RunVmValidator for suspended VMs, most
checks are irrelevant for this use-case. These checks prevented from
resuming VMs which passed the original run validations using run-once options.

Change-Id: Ib86e5764187a6ba12b13111392e7f992644368c5
Bug-Url: https://bugzilla.redhat.com/1167374
Signed-off-by: Eldan Shachar <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/RunVmValidator.java
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/36552/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/RunVmValidator.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/RunVmValidator.java
index 65048dd..9d5dc52 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/RunVmValidator.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/RunVmValidator.java
@@ -105,6 +105,16 @@
             // if the VM is paused, we should only check the VDS status
             // as the rest of the checks were already checked before
             return validate(validateVdsStatus(vm), messages);
+        } else if (vm.getStatus() == VMStatus.Suspended) {
+            return validate(new VmValidator(vm).vmNotLocked(), messages) &&
+                   
validate(getSnapshotValidator().vmNotDuringSnapshot(vm.getId()), messages) &&
+                   validate(validateVmStatusUsingMatrix(vm), messages) &&
+                   validate(validateStoragePoolUp(vm, storagePool, 
getVmImageDisks()), messages) &&
+                   validate(vmDuringInitialization(vm), messages) &&
+                   validate(validateStorageDomains(vm, isInternalExecution, 
getVmImageDisks()), messages) &&
+                   validate(validateImagesForRunVm(vm, getVmImageDisks()), 
messages) &&
+                   SchedulingManager.getInstance().canSchedule(
+                            vdsGroup, vm, vdsBlackList, vdsWhiteList, destVds, 
messages);
         }
 
         return


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

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

Reply via email to