mooli tayer has posted comments on this change.
Change subject: libvirtconnection: ping libvirt upon disconnection
......................................................................
Patch Set 12:
(1 comment)
Regarding my tests problem, I assume it is not related to my patch but to the issues with
live migration disccussed on vdsm-devel.
....................................................
File lib/vdsm/libvirtconnection.py
Line 131: log.debug('trying to connect libvirt')
Line 132: conn = utils.retry(libvirtOpenAuth, timeout=10, sleep=0.2)
Line 133: __connections[id(target)] = conn
Line 134:
Line 135: setattr(conn, 'pingLibvirt', getattr(conn,
'getLibVersion'))
Yaniv is right, using getLibVersion creates an infinate loop. getLibVersion is a wrapped
version at the point we need to call ping. If libvirt is down we will keep going through
the code in line 94.
Doing it this way is the best trade off I found between small fingerprint on the wrapped
class and writing code that is simple.
Regarding the AttributeError, as saggy commented, libvirt api is not expected to change
and in case it does we should any way let the exception propagate up.
Line 136: for name in dir(libvirt.virConnect):
Line 137: method = getattr(conn, name)
Line 138: if callable(method) and name[0] != '_':
Line 139: setattr(conn, name, wrapMethod(method))
--
To view, visit
http://gerrit.ovirt.org/19444
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia489e46dd8ce4c70c888988d17b86311d3c4b935
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes