Change in vdsm[master]: virt: sampling: more cautious disk stats check

fromani at redhat.com fromani at redhat.com
Mon Sep 29 13:22:02 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: virt: sampling: more cautious disk stats check
......................................................................

virt: sampling: more cautious disk stats check

In commit d6d0eb763e623 we changed the disk stats
collection to deal with the benign case of
known-missing disk stats samples, to avoid add
bogus error on the logs.

Unfortunately a case was missing in the live
storage migration flow, which causes

TypeError: argument of type 'NoneType' is not iterable

in the logs defeating the purposes of the
originating change.
This patch fixes this issue by adding the missing
check.

Change-Id: I059b69c33d45950f8377597ee8c6e7824e1ec223
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/33482/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index ad8cb0e..0f8845e 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -539,7 +539,7 @@
                     dStats['imageID'] = vmDrive.imageID
                 elif "GUID" in vmDrive:
                     dStats['lunGUID'] = vmDrive.GUID
-                if sInfo is not None and (
+                if sInfo is not None and eInfo is not None and (
                         vmDrive.name in sInfo and vmDrive.name in eInfo):
                     # will be None if sampled during recovery
                     dStats.update(self._calcDiskRate(vmDrive, sInfo, eInfo,
@@ -594,7 +594,8 @@
                         'writeLatency': '0',
                         'flushLatency': '0'}
 
-            if sInfo is not None and (dName in sInfo and dName in eInfo):
+            if sInfo is not None and eInfo is not None and (
+                    dName in sInfo and dName in eInfo):
                 # will be None if sampled during recovery
                 # in case of hotplugged disk, start samples will
                 # be missed until the sampling code catches up.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I059b69c33d45950f8377597ee8c6e7824e1ec223
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list