Gal Hammer has posted comments on this change.
Change subject: prepareForShutdown is not called when connection to libvirt is
broken.
......................................................................
Patch Set 5: (2 inline comments)
....................................................
File vdsm/libvirtconnection.py
Line 86: if callable(method) and name[0] != '_':
Line 87: setattr(ret, name, wrapMethod(method))
Line 88: return ret
Line 89: except libvirt.libvirtError, e:
Line 90: if (e.get_error_domain() in (libvirt.VIR_FROM_REMOTE,
White space at the end of the line.
Line 91: libvirt.VIR_FROM_RPC,
Line 92:
libvirt.VIR_ERR_NO_CONNECT,
Line 93:
libvirt.VIR_ERR_INVALID_CONN)
Line 94: and e.get_error_code() ==
libvirt.VIR_ERR_SYSTEM_ERROR):
Line 90: if (e.get_error_domain() in (libvirt.VIR_FROM_REMOTE,
Line 91: libvirt.VIR_FROM_RPC,
Line 92:
libvirt.VIR_ERR_NO_CONNECT,
Line 93:
libvirt.VIR_ERR_INVALID_CONN)
Line 94: and e.get_error_code() ==
libvirt.VIR_ERR_SYSTEM_ERROR):
I would replace the condition order. First check the error_code and only then
check the error_domain.
It would probably will save less than 1ms on an error :-).
Line 95: cif.log.error('connection to libvirt broken. '
Line 96: 'taking vdsm down.')
Line 97: cif.prepareForShutdown()
Line 98: raise
--
To view, visit http://gerrit.ovirt.org/8283
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic1d9a2cd9bfd7da9118d643d0e50106e5e759590
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Gal Hammer <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Peter V. Saveliev <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches