cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [33/50] [abbrv] git commit: updated refs/heads/ui-restyle to 500c798
Date Thu, 24 Oct 2013 18:31:11 GMT
fixed NPE


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

Branch: refs/heads/ui-restyle
Commit: 7120c1eb975cdee4b861f904c6bd9dcd379c2a7c
Parents: 891b85d
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Wed Oct 23 15:23:35 2013 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Wed Oct 23 15:26:20 2013 -0700

----------------------------------------------------------------------
 .../xen/resource/XenServer56FP1Resource.java    | 26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7120c1eb/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
index 214dbd4..4a9b526 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
@@ -169,7 +169,6 @@ public class XenServer56FP1Resource extends XenServer56Resource {
         vmr.actionsAfterCrash = Types.OnCrashBehaviour.DESTROY;
         vmr.actionsAfterShutdown = Types.OnNormalExit.DESTROY;
 
-        Map<String, String> details = vmSpec.getDetails();
         if (isDmcEnabled(conn, host) && vmSpec.isEnableDynamicallyScaleVm()) {
             //scaling is allowed
             vmr.memoryStaticMin = getStaticMin(vmSpec.getOs(), vmSpec.getBootloader() ==
BootloaderType.CD, vmSpec.getMinRam(), vmSpec.getMaxRam());
@@ -193,18 +192,21 @@ public class XenServer56FP1Resource extends XenServer56Resource {
             vmr.VCPUsMax = 32L;
         }
 
-        String timeoffset = details.get("timeoffset");
-        if (timeoffset != null) {
-            Map<String, String> platform = vmr.platform;
-            platform.put("timeoffset", timeoffset);
-            vmr.platform = platform;
-        }
+        Map<String, String> details = vmSpec.getDetails();
+        if ( details != null ) {
+            String timeoffset = details.get("timeoffset");
+            if (timeoffset != null) {
+                Map<String, String> platform = vmr.platform;
+                platform.put("timeoffset", timeoffset);
+                vmr.platform = platform;
+            }
 
-        String coresPerSocket = details.get("cpu.corespersocket");
-        if (coresPerSocket != null) {
-            Map<String, String> platform = vmr.platform;
-            platform.put("cores-per-socket", coresPerSocket);
-            vmr.platform = platform;
+            String coresPerSocket = details.get("cpu.corespersocket");
+            if (coresPerSocket != null) {
+                Map<String, String> platform = vmr.platform;
+                platform.put("cores-per-socket", coresPerSocket);
+                vmr.platform = platform;
+            }            
         }
 
         vmr.VCPUsAtStartup = (long) vmSpec.getCpus();


Mime
View raw message