cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject git commit: updated refs/heads/master to db97bb8
Date Sat, 22 Jun 2013 00:16:49 GMT
Updated Branches:
  refs/heads/master 64c5266ec -> db97bb8e8


Fix NPE when using baremetal template

Template size is NULL for baremetal, which caused NPE when unboxing


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

Branch: refs/heads/master
Commit: db97bb8e8905feb8e1444fb5136ba893e304670c
Parents: 64c5266
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Fri Jun 21 17:15:50 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Fri Jun 21 17:16:33 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/db97bb8e/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 7ae96da..7b3b1bc 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2450,7 +2450,12 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
 
         // check if account/domain is with in resource limits to create a new vm
         boolean isIso = Storage.ImageFormat.ISO == template.getFormat();
-        long size = _templateDao.findById(template.getId()).getSize();
+        // For baremetal, size can be null
+        Long tmp = _templateDao.findById(template.getId()).getSize();
+        long size = 0;
+        if (tmp != null) {
+        	size = tmp;
+        }
         if (diskOfferingId != null) {
             size += _diskOfferingDao.findById(diskOfferingId).getDiskSize();
         }


Mime
View raw message