incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [35/40] git commit: refs/heads/master - Rebase with master, bring into Vmware vswitch change.
Date Tue, 05 Mar 2013 02:09:46 GMT
Rebase with master, bring into Vmware vswitch change.

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

Branch: refs/heads/master
Commit: bcaac324aa995480830c60cbe77025b1f5c446fe
Parents: 93f14e7
Author: Min Chen <min.chen@citrix.com>
Authored: Thu Feb 28 11:00:03 2013 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Feb 28 11:00:03 2013 -0800

----------------------------------------------------------------------
 .../cloud/hypervisor/vmware/mo/DatacenterMO.java   |    4 +-
 .../vmware/mo/DistributedVirtualSwitchMO.java      |   12 ++++++----
 .../cloud/hypervisor/vmware/util/VmwareClient.java |   16 +++++++++++++++
 3 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/bcaac324/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
index 7df0cf4..0a3e20b 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java
@@ -484,8 +484,8 @@ public class DatacenterMO extends BaseMO {
     public ManagedObjectReference getDvSwitchMor(String dvSwitchName) throws Exception {
         ManagedObjectReference dvSwitchMor = null;
         ManagedObjectReference networkFolderMor = null;
-        networkFolderMor = _context.getServiceUtil().getMoRefProp(_mor, "networkFolder");
-        dvSwitchMor = _context.getServiceUtil().getDecendentMoRef(networkFolderMor, "VmwareDistributedVirtualSwitch",
dvSwitchName);
+        networkFolderMor = _context.getVimClient().getMoRefProp(_mor, "networkFolder");
+        dvSwitchMor = _context.getVimClient().getDecendentMoRef(networkFolderMor, "VmwareDistributedVirtualSwitch",
dvSwitchName);
         return dvSwitchMor;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/bcaac324/vmware-base/src/com/cloud/hypervisor/vmware/mo/DistributedVirtualSwitchMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DistributedVirtualSwitchMO.java
b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DistributedVirtualSwitchMO.java
index 494477e..247be2a 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DistributedVirtualSwitchMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DistributedVirtualSwitchMO.java
@@ -16,11 +16,13 @@
 // under the License.
 package com.cloud.hypervisor.vmware.mo;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.log4j.Logger;
 
 import com.cloud.hypervisor.vmware.util.VmwareContext;
 import com.vmware.vim25.DVPortgroupConfigSpec;
-import com.vmware.vim25.HostPortGroupSpec;
 import com.vmware.vim25.ManagedObjectReference;
 
 public class DistributedVirtualSwitchMO extends BaseMO {
@@ -35,13 +37,13 @@ public class DistributedVirtualSwitchMO extends BaseMO {
     }
 
     public void createDVPortGroup(DVPortgroupConfigSpec dvPortGroupSpec) throws Exception
{
-        DVPortgroupConfigSpec[] dvPortGroupSpecArray = new DVPortgroupConfigSpec[1];
-        dvPortGroupSpecArray[0] = dvPortGroupSpec;
-        _context.getService().addDVPortgroup_Task(_mor, dvPortGroupSpecArray);
+        List<DVPortgroupConfigSpec> dvPortGroupSpecArray = new ArrayList<DVPortgroupConfigSpec>();
+        dvPortGroupSpecArray.add(dvPortGroupSpec);
+        _context.getService().addDVPortgroupTask(_mor, dvPortGroupSpecArray);
     }
 
     public void updateDvPortGroup(ManagedObjectReference dvPortGroupMor, DVPortgroupConfigSpec
dvPortGroupSpec) throws Exception {
         // TODO(sateesh): Update numPorts
-        _context.getService().reconfigureDVPortgroup_Task(dvPortGroupMor, dvPortGroupSpec);
+        _context.getService().reconfigureDVPortgroupTask(dvPortGroupMor, dvPortGroupSpec);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/bcaac324/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
index 21c649a..fc307f8 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java
@@ -540,4 +540,20 @@ public class VmwareClient {
         }
         return null;
     }
+
+    /**
+     * Get a MORef from the property returned.
+     *
+     * @param objMor Object to get a reference property from
+     * @param propName name of the property that is the MORef
+     * @return the ManagedObjectReference for that property.
+     */
+    public ManagedObjectReference getMoRefProp(ManagedObjectReference objMor, String propName)
throws Exception {
+       Object props = getDynamicProperty(objMor, propName);
+       ManagedObjectReference propmor = null;
+       if (!props.getClass().isArray()) {
+          propmor = (ManagedObjectReference)props;
+       }
+       return propmor;
+    }
 }


Mime
View raw message