cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: updated refs/heads/4.2 to 4e7b1de
Date Fri, 09 Aug 2013 00:53:19 GMT
Updated Branches:
  refs/heads/4.2 b2264afef -> 4e7b1de45


CLOUDSTACK-3778: serialize configuration of port group at per-host level to prevent run-time
race condition


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

Branch: refs/heads/4.2
Commit: 4e7b1de45aa5911e180e136eedef3524664db2d8
Parents: b2264af
Author: Kelven Yang <kelveny@gmail.com>
Authored: Thu Aug 8 17:41:24 2013 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Thu Aug 8 17:41:45 2013 -0700

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java    | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4e7b1de4/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 8b08234..409c1f3 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -1905,8 +1905,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
          *  so we assume that it's VLAN for now
          */
         if (VirtualSwitchType.StandardVirtualSwitch == vSwitchType) {
-            networkInfo = HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(),
"cloud.public",
-                    vmMo.getRunningHost(), vlanId, null, null, _ops_timeout, true, BroadcastDomainType.Vlan,
null);
+        	synchronized(vmMo.getRunningHost().getMor().getValue().intern()) {
+	            networkInfo = HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(),
"cloud.public",
+	                    vmMo.getRunningHost(), vlanId, null, null, _ops_timeout, true, BroadcastDomainType.Vlan,
null);
+        	}
         } else {
             networkInfo = HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(),
"cloud.public",
                     vmMo.getRunningHost(), vlanId, null, null, null, _ops_timeout, vSwitchType,
_portsPerDvPortGroup, null, false, BroadcastDomainType.Vlan);
@@ -3234,9 +3236,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         s_logger.info("Prepare network on " + switchType + " " + switchName + " with name
prefix: " + namePrefix);
 
         if (VirtualSwitchType.StandardVirtualSwitch == switchType) {
-            networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix,
-                    hostMo, getVlanInfo(nicTo, switchName.second()), nicTo.getNetworkRateMbps(),
nicTo.getNetworkRateMulticastMbps(), _ops_timeout,
-                    !namePrefix.startsWith("cloud.private"), nicTo.getBroadcastType(), nicTo.getUuid());
+        	synchronized(hostMo.getMor().getValue().intern()) {
+	            networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix,
+	                    hostMo, getVlanInfo(nicTo, switchName.second()), nicTo.getNetworkRateMbps(),
nicTo.getNetworkRateMulticastMbps(), _ops_timeout,
+	                    !namePrefix.startsWith("cloud.private"), nicTo.getBroadcastType(), nicTo.getUuid());
+        	}
         }
         else {
             String vlanId = getVlanInfo(nicTo, switchName.second());


Mime
View raw message