cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject git commit: updated refs/heads/master to 38c0dd8
Date Thu, 06 Mar 2014 00:05:05 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master ad88bbb68 -> 38c0dd87a


vbdmectics may not exist after host reboot


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

Branch: refs/heads/master
Commit: 38c0dd87a9ad0b558ed6aedd521c21bc10a60fd0
Parents: ad88bbb
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Wed Mar 5 16:04:34 2014 -0800
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Wed Mar 5 16:04:34 2014 -0800

----------------------------------------------------------------------
 .../hypervisor/xen/resource/CitrixResourceBase.java     | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38c0dd87/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 4a5de18..b1ad63a 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -2361,9 +2361,15 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 double diskReadKBs = 0;
                 double diskWriteKBs = 0;
                 for (VBD vbd : vm.getVBDs(conn)) {
-                    VBDMetrics record = vbd.getMetrics(conn);
-                    diskReadKBs += record.getIoReadKbs(conn);
-                    diskWriteKBs += record.getIoWriteKbs(conn);
+                    VBDMetrics vbdmetrics = vbd.getMetrics(conn);
+                    if (!isRefNull(vbdmetrics)) {
+                        try {
+                            diskReadKBs += vbdmetrics.getIoReadKbs(conn);
+                            diskWriteKBs += vbdmetrics.getIoWriteKbs(conn);
+                        }  catch (Types.HandleInvalid e) {
+                            s_logger.debug("vbdmetrics doesn't exist ");
+                        }
+                    }
                 }
                 if (stats == null) {
                     stats = new VmStatsEntry();


Mime
View raw message