cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject git commit: updated refs/heads/master to 181567b
Date Thu, 27 Jun 2013 12:26:05 GMT
Updated Branches:
  refs/heads/master 8745316f2 -> 181567ba7


CLOUDSTACK-1192: Disk I/O Statistics (vm stats) support KVM and XenServer only util 2013/06/25


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

Branch: refs/heads/master
Commit: 181567ba746b5a0a5528a87f06a6dfc734fffd82
Parents: 8745316
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Thu Jun 27 14:25:54 2013 +0200
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Thu Jun 27 14:25:54 2013 +0200

----------------------------------------------------------------------
 .../cloud/api/query/dao/UserVmJoinDaoImpl.java  | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/181567ba/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
index 0280834..241c073 100644
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@ -38,6 +38,7 @@ import com.cloud.api.ApiDBUtils;
 import com.cloud.api.query.vo.ResourceTagJoinVO;
 import com.cloud.api.query.vo.UserVmJoinVO;
 import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.user.Account;
 import com.cloud.uservm.UserVm;
 import com.cloud.utils.db.GenericDaoBase;
@@ -180,17 +181,21 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO,
Long> implem
                 Double networkKbWrite = Double.valueOf(vmStats.getNetworkWriteKBs());
                 userVmResponse.setNetworkKbsWrite(networkKbWrite.longValue());
 
-                Double diskKbsRead = Double.valueOf(vmStats.getDiskReadKBs());
-                userVmResponse.setDiskKbsRead(diskKbsRead.longValue());
+                if ((userVm.getHypervisorType() != null) 
+                        && (userVm.getHypervisorType().equals(HypervisorType.KVM)
+                        || userVm.getHypervisorType().equals(HypervisorType.XenServer)))
{ // support KVM and XenServer only util 2013.06.25
+                    Double diskKbsRead = Double.valueOf(vmStats.getDiskReadKBs());
+                    userVmResponse.setDiskKbsRead(diskKbsRead.longValue());
 
-                Double diskKbsWrite = Double.valueOf(vmStats.getDiskWriteKBs());
-                userVmResponse.setDiskKbsWrite(diskKbsWrite.longValue());
+                    Double diskKbsWrite = Double.valueOf(vmStats.getDiskWriteKBs());
+                    userVmResponse.setDiskKbsWrite(diskKbsWrite.longValue());
 
-                Double diskIORead = Double.valueOf(vmStats.getDiskReadIOs());
-                userVmResponse.setDiskIORead(diskIORead.longValue());
+                    Double diskIORead = Double.valueOf(vmStats.getDiskReadIOs());
+                    userVmResponse.setDiskIORead(diskIORead.longValue());
 
-                Double diskIOWrite = Double.valueOf(vmStats.getDiskWriteIOs());
-                userVmResponse.setDiskIOWrite(diskIOWrite.longValue());
+                    Double diskIOWrite = Double.valueOf(vmStats.getDiskWriteIOs());
+                    userVmResponse.setDiskIOWrite(diskIOWrite.longValue());
+                }
             }
         }
 


Mime
View raw message