Martin Sivák has uploaded a new change for review.

Change subject: restapi: Do not cast memory.used to int
......................................................................

restapi: Do not cast memory.used to int

Casting the computed value to int caused an overflow
when the value was higher than about 4G. That is not
that unusual nowadays..

Change-Id: I216ac4ef5cf4cfd8cf523a84f75b252e0ce65ad0
Bug-Url: https://bugzilla.redhat.com/???
Signed-off-by: Martin Sivak <[email protected]>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/VmStatisticalQuery.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/41/24941/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/VmStatisticalQuery.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/VmStatisticalQuery.java
index b9da037..5d5bb30 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/VmStatisticalQuery.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/VmStatisticalQuery.java
@@ -32,7 +32,7 @@
         Double cpuUser = s.getcpu_user()==null ? zero : s.getcpu_user();
         Double cpuSys = s.getcpu_sys()==null ? zero : s.getcpu_sys();
         return asList(setDatum(clone(MEM_CONFIG),   mem),
-                      setDatum(clone(MEM_USED),     (int)(memUsedByCent/100)),
+                      setDatum(clone(MEM_USED),     memUsedByCent/100),
                       setDatum(clone(CPU_GUEST),    cpuUser),
                       setDatum(clone(CPU_OVERHEAD), cpuSys),
                       setDatum(clone(CPU_TOTAL),    cpuUser + cpuSys));


-- 
To view, visit http://gerrit.ovirt.org/24941
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I216ac4ef5cf4cfd8cf523a84f75b252e0ce65ad0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Martin Sivák <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to