Allon Mureinik has uploaded a new change for review.

Change subject: core: ExportVm vmDown validation
......................................................................

core: ExportVm vmDown validation

Added an explicit test for VM.isDown in
ExportVmCommand.canDoAction() instead of using
ImagesHandler.PerformImagesChecks to do it.

Note: This patch is part of a series intended to remove the VM
status check from ImagesHandler.

Change-Id: I0d48868ea1a292e7b655f27e3984606d152f9866
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/16/11016/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
index 3aa8ca9..7138ede 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmCommand.java
@@ -14,6 +14,7 @@
 import org.ovirt.engine.core.bll.snapshots.SnapshotsValidator;
 import org.ovirt.engine.core.bll.utils.VmDeviceUtils;
 import org.ovirt.engine.core.bll.validator.StorageDomainValidator;
+import org.ovirt.engine.core.bll.validator.VmValidator;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters;
@@ -26,12 +27,12 @@
 import org.ovirt.engine.core.common.businessentities.DiskImage;
 import org.ovirt.engine.core.common.businessentities.Snapshot;
 import org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType;
-import 
org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface;
 import org.ovirt.engine.core.common.businessentities.StorageDomainType;
 import org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId;
 import org.ovirt.engine.core.common.businessentities.VM;
 import org.ovirt.engine.core.common.businessentities.VmTemplate;
 import org.ovirt.engine.core.common.businessentities.VolumeFormat;
+import 
org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface;
 import org.ovirt.engine.core.common.errors.VdcBLLException;
 import org.ovirt.engine.core.common.locks.LockingGroup;
 import org.ovirt.engine.core.common.queries.DiskImageList;
@@ -151,7 +152,9 @@
             return false;
         }
 
-        if (!(checkVmInStorageDomain() && validate(new 
SnapshotsValidator().vmNotDuringSnapshot(getVmId()))
+        if (!(checkVmInStorageDomain()
+                && validate(new 
SnapshotsValidator().vmNotDuringSnapshot(getVmId()))
+                && validate(new VmValidator(getVm()).vmDown())
                 && ImagesHandler.PerformImagesChecks(getVm(),
                         getReturnValue().getCanDoActionMessages(),
                         getVm().getStoragePoolId(),
@@ -161,7 +164,7 @@
                         false,
                         false,
                         true,
-                        true,
+                        false,
                         true,
                         true,
                         getDisksBasedOnImage()))) {


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

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

Reply via email to