From df7e8169b694336bdb75894459b9d7f7bb744ced Mon Sep 17 00:00:00 2001 From: anthony Date: Fri, 7 Jan 2011 11:53:46 -0800 Subject: [PATCH] bug 5873: if usedcapacity is larger than totalcapacity, return totalcapacity, because we preserved resources for stopped VM, at some point, usedcapacity may be larger than totalcapacity status 5873: resolved fixed --- server/src/com/cloud/api/commands/ListCapacityCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/commands/ListCapacityCmd.java b/server/src/com/cloud/api/commands/ListCapacityCmd.java index 59f4fd9904a..d6c3628ba1c 100644 --- a/server/src/com/cloud/api/commands/ListCapacityCmd.java +++ b/server/src/com/cloud/api/commands/ListCapacityCmd.java @@ -208,7 +208,7 @@ public class ListCapacityCmd extends BaseCmd{ } summedCapacity.setTotalCapacity(totalCapacityMap.get(key)); - summedCapacity.setUsedCapacity(usedCapacityMap.get(key)); + summedCapacity.setUsedCapacity((usedCapacityMap.get(key) > totalCapacityMap.get(key)) ? totalCapacityMap.get(key):usedCapacityMap.get(key)); summedCapacities.add(summedCapacity); }