You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/06/15 04:52:03 UTC

[03/50] [abbrv] git commit: updated refs/heads/object_store to f41c800

CLOUDSTACK-2946
CS-15158: Correcting the allocated size for local storage in listStoragePools


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

Branch: refs/heads/object_store
Commit: 83fcba9ee64cdf4fe28e2c751fcfb2f83f9938d2
Parents: 215b638
Author: Nitin Mehta <ni...@citrix.com>
Authored: Wed Jun 12 14:58:54 2013 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Wed Jun 12 14:58:54 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/83fcba9e/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
index a6355ad..6d0cde1 100644
--- a/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/StoragePoolJoinDaoImpl.java
@@ -22,7 +22,9 @@ import java.util.List;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
+import com.cloud.capacity.Capacity;
 import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -150,7 +152,8 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
         }
 
 
-        long allocatedSize = pool.getUsedCapacity() +  pool.getReservedCapacity();
+        short capacityType = pool.getScope() == ScopeType.HOST ? Capacity.CAPACITY_TYPE_LOCAL_STORAGE : Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED;
+        long allocatedSize = ApiDBUtils.getStorageCapacitybyPool(pool.getId(), capacityType);
         poolResponse.setDiskSizeTotal(pool.getCapacityBytes());
         poolResponse.setDiskSizeAllocated(allocatedSize);