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))