cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject git commit: updated refs/heads/master to cc18ca7
Date Tue, 20 Aug 2013 13:30:15 GMT
Updated Branches:
  refs/heads/master a5ada3f36 -> cc18ca79f


CLOUDSTACK-3851 [VMWare] VM start fails with NPE while trying to retrieve cores per socket

If VMware host version is ESXi 4.1 and vCenter version is 5.0 or later, number of cores per
socket of a VM running on ESXi 4.1 host would be undefined as it's not supported for versions
prior to 5.0.
Hence expecting undefined/null value for that and handling it.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>


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

Branch: refs/heads/master
Commit: cc18ca79fc6d58fb639ffbb455791caeb021589a
Parents: a5ada3f
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Tue Aug 20 13:28:14 2013 +0530
Committer: Sateesh Chodapuneedi <sateesh@apache.org>
Committed: Tue Aug 20 13:29:49 2013 +0530

----------------------------------------------------------------------
 .../src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cc18ca79/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index 6c33eea..e8cbe8f 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -2205,7 +2205,8 @@ public class VirtualMachineMO extends BaseMO {
         if (apiVersion.compareTo("5.0") < 0) {
             return 1;
         }
-        return (Integer)_context.getVimClient().getDynamicProperty(_mor, "config.hardware.numCoresPerSocket");
+        Integer coresPerSocket = (Integer) _context.getVimClient().getDynamicProperty(_mor,
"config.hardware.numCoresPerSocket");
+        return coresPerSocket != null? coresPerSocket : 1;
     }
 
     public int getVirtualHardwareVersion() throws Exception {


Mime
View raw message