Vinzenz Feenstra has uploaded a new change for review. Change subject: vdsm: Fix check for connection issues with libvirt ......................................................................
vdsm: Fix check for connection issues with libvirt There has been a made a mistake by mixing domain codes with error codes of libvirt. Additionally libvirt is reporting VIR_ERR_INTERNAL_ERROR if libvirtd gets restarted or stopped somehow (e.g. after a crash) This fix takes care to cleanup the mixup and adds the missing error code. Change-Id: I051d007529e22b0c4ca703042ce1601b4b2817e0 Signed-off-by: Vinzenz Feenstra <[email protected]> Bug-Url: https://bugzilla.redhat.com/852956 --- M lib/vdsm/libvirtconnection.py 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/13990/1 diff --git a/lib/vdsm/libvirtconnection.py b/lib/vdsm/libvirtconnection.py index 4a9a09a..1a2d5ac 100644 --- a/lib/vdsm/libvirtconnection.py +++ b/lib/vdsm/libvirtconnection.py @@ -119,13 +119,19 @@ edom = e.get_error_domain() ecode = e.get_error_code() EDOMAINS = (libvirt.VIR_FROM_REMOTE, - libvirt.VIR_FROM_RPC, - libvirt.VIR_ERR_NO_CONNECT, - libvirt.VIR_ERR_INVALID_CONN) - if edom in EDOMAINS and ecode == libvirt.VIR_ERR_SYSTEM_ERROR: + libvirt.VIR_FROM_RPC) + ECODES = (libvirt.VIR_ERR_SYSTEM_ERROR, + libvirt.VIR_ERR_INTERNAL_ERROR, + libvirt.VIR_ERR_NO_CONNECT, + libvirt.VIR_ERR_INVALID_CONN) + if edom in EDOMAINS and ecode in ECODES: cif.log.error('connection to libvirt broken. ' - 'taking vdsm down.') + 'taking vdsm down. ecode: %d edom: %d', + ecode, edom) cif.prepareForShutdown() + else: + cif.log.exception('Unknown libvirterror: ecode: %d ' + 'edom: %d', ecode, edom) raise wrapper.__name__ = f.__name__ wrapper.__doc__ = f.__doc__ -- To view, visit http://gerrit.ovirt.org/13990 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I051d007529e22b0c4ca703042ce1601b4b2817e0 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vinzenz Feenstra <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
