cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [02/28] git commit: updated refs/heads/4.4 to 392dc81
Date Fri, 28 Mar 2014 00:39:11 GMT
CLOUDSTACK-4506: fix NPE in case hostid is null

Conflicts:

	server/src/com/cloud/capacity/CapacityManagerImpl.java


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

Branch: refs/heads/4.4
Commit: 0bbb8437cd8ac7bc7c27db4318c589edf8c2bb80
Parents: eacc1d7
Author: Edison Su <sudison@gmail.com>
Authored: Thu Mar 27 15:19:50 2014 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Thu Mar 27 17:38:35 2014 -0700

----------------------------------------------------------------------
 server/src/com/cloud/capacity/CapacityManagerImpl.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0bbb8437/server/src/com/cloud/capacity/CapacityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/capacity/CapacityManagerImpl.java b/server/src/com/cloud/capacity/CapacityManagerImpl.java
index 69e8cfa..cef019d 100755
--- a/server/src/com/cloud/capacity/CapacityManagerImpl.java
+++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java
@@ -182,6 +182,10 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
     @DB
     @Override
     public boolean releaseVmCapacity(VirtualMachine vm, final boolean moveFromReserved, final
boolean moveToReservered, final Long hostId) {
+        if (hostId == null) {
+            return true;
+        }
+
         final ServiceOfferingVO svo = _offeringsDao.findById(vm.getId(), vm.getServiceOfferingId());
         CapacityVO capacityCpu = _capacityDao.findByHostIdType(hostId, Capacity.CAPACITY_TYPE_CPU);
         CapacityVO capacityMemory = _capacityDao.findByHostIdType(hostId, Capacity.CAPACITY_TYPE_MEMORY);


Mime
View raw message