Dan Kenigsberg has posted comments on this change.
Change subject: vm: Fix attribute error when accessing drive in sampling method
......................................................................
Patch Set 1: Code-Review-1
(2 comments)
....................................................
Commit Message
Line 6:
Line 7: vm: Fix attribute error when accessing drive in sampling method
Line 8:
Line 9: Du to race when migration is finished and monitoring, drive may not have
Line 10: a format attribute when accessing it from the monitor. This patch use
I think that this commit message is misleading, then. It's not a fix, it's a
silent ignoring of a possibly-broken condition. We are not sure which race is involved
here. Would a subject line of "Use getattr to avoid log spamming" be more
precise?
Now I do not mind loosing _highWrite events on this broken temporal occasion. And we can
hide this condition, as it confuses users and ourselves. Posting this patch for testing on
ovirt-3.3 branch was fine, too.
However, we should not take it in without a matching patch to master (even if the code
moved), or else we'd forget the patch, and see the problem popping again on ovirt-3.4.
Would you use the same ChangeID for a similar tweak of the parallel code in master?
Thanks!
The existing mangling of attributes is horrible, for sure.
Line 11: getattr to log spam.
Line 12:
Line 13: Change-Id: Ia50e8af94b9c9b54332066a3f30999ce73e7a56f
....................................................
File vdsm/vm.py
Line 506: return
Line 507:
Line 508: for vmDrive in self._vm._devices[DISK_DEVICES]:
Line 509: # Note: drive may not have a format attribute during migration
Line 510: if not vmDrive.blockDev or getattr(vmDrive, 'format', None)
!= 'cow':
how come pep8 has not cried about this glitch?
Line 511: continue
Line 512:
Line 513: capacity, alloc, physical = \
Line 514: self._vm._dom.blockInfo(vmDrive.path, 0)
--
To view, visit
http://gerrit.ovirt.org/22518
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia50e8af94b9c9b54332066a3f30999ce73e7a56f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgotliv(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-HasComments: Yes