Hello Nir Soffer, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/33623

to review the following change.

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 <from...@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/33482
Reviewed-by: Nir Soffer <nsof...@redhat.com>
Reviewed-by: Dan Kenigsberg <dan...@redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/33623/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0f9e4ce..df46922 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -544,8 +544,8 @@
                     dStats['imageID'] = vmDrive.imageID
                 elif "GUID" in vmDrive:
                     dStats['lunGUID'] = vmDrive.GUID
-                if sInfo is not None and (
-                        vmDrive.name in sInfo and vmDrive.name in eInfo):
+                if (sInfo and vmDrive.name in sInfo and
+                   eInfo and vmDrive.name in eInfo):
                     # will be None if sampled during recovery
                     dStats['readRate'] = (
                         (eInfo[dName][1] - sInfo[dName][1]) / sampleInterval)
@@ -589,7 +589,7 @@
                         'writeLatency': '0',
                         'flushLatency': '0'}
 
-            if sInfo is not None and (dName in sInfo and dName in eInfo):
+            if (sInfo and dName in sInfo and eInfo 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/33623
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I059b69c33d45950f8377597ee8c6e7824e1ec223
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to