cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/4.2 to d9ba83f
Date Tue, 30 Jul 2013 18:34:56 GMT
Updated Branches:
  refs/heads/4.2 de1865ae5 -> d9ba83f0a


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/d9ba83f0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d9ba83f0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d9ba83f0

Branch: refs/heads/4.2
Commit: d9ba83f0a4c8a2ed250b868701a6b4e22f40f420
Parents: de1865a
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 11:34:40 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/d9ba83f0/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 2288642..2373d09 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