cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [1/3] git commit: updated refs/heads/master to 7774ecf
Date Tue, 30 Jul 2013 23:17:30 GMT
Updated Branches:
  refs/heads/master 1e1ee902a -> 7774ecfd5


CLOUDSTACK-3944: fix regression for vmware


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c42f51d7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c42f51d7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c42f51d7

Branch: refs/heads/master
Commit: c42f51d75b0fa237c69b4b4228dc1f82347e255a
Parents: 1e1ee90
Author: Edison Su <sudison@gmail.com>
Authored: Tue Jul 30 11:34:19 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Tue Jul 30 16:17:02 2013 -0700

----------------------------------------------------------------------
 .../com/cloud/hypervisor/guru/VMwareGuru.java    | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c42f51d7/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index 7d0c12a..95152fc 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -300,11 +300,6 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru
{
     public Pair<Boolean, Long> getCommandHostDelegation(long hostId, Command cmd) {
         boolean needDelegation = false;
 
-        HostVO host = _hostDao.findById(hostId);
-        if (host.getHypervisorType() != HypervisorType.VMware) {
-            return new Pair<Boolean, Long>(Boolean.FALSE, new Long(hostId));
-        }
-
         if (cmd instanceof CopyCommand) {
             CopyCommand cpyCommand = (CopyCommand)cmd;
             DataTO srcData = cpyCommand.getSrcTO();
@@ -312,12 +307,6 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru
{
             DataTO destData = cpyCommand.getDestTO();
             DataStoreTO destStoreTO = destData.getDataStore();
 
-            if ((HypervisorType.VMware == srcData.getHypervisorType() ||
-                    HypervisorType.VMware == destData.getHypervisorType()
-            )) {
-                needDelegation = true;
-            }
-
             if (srcData.getObjectType() == DataObjectType.VOLUME) {
                 VolumeObjectTO volumeObjectTO = (VolumeObjectTO)srcData;
                 if (Storage.ImageFormat.OVA == volumeObjectTO.getFormat()) {
@@ -325,6 +314,12 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru
{
                 }
             }
 
+            if (!needDelegation && !(HypervisorType.VMware == srcData.getHypervisorType()
||
+                    HypervisorType.VMware == destData.getHypervisorType()
+            )) {
+                return new Pair<Boolean, Long>(Boolean.FALSE, new Long(hostId));
+            }
+
             if (destData.getObjectType() == DataObjectType.VOLUME && destStoreTO.getRole()
== DataStoreRole.Primary &&
                     srcData.getObjectType() == DataObjectType.TEMPLATE && srcStoreTO.getRole()
== DataStoreRole.Primary) {
                 needDelegation = false;
@@ -347,7 +342,7 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru
{
         if(!needDelegation) {
             return new Pair<Boolean, Long>(Boolean.FALSE, new Long(hostId));
         }
-
+        HostVO host = _hostDao.findById(hostId);
         long dcId = host.getDataCenterId();
         Pair<HostVO, SecondaryStorageVmVO> cmdTarget = _secStorageMgr.assignSecStorageVm(dcId,
cmd);
         if(cmdTarget != null) {


Mime
View raw message