Only close connection on error from 'remote' error domain.

This commit is contained in:
Cole Robinson 2010-04-21 10:08:04 -04:00
parent 575120aa88
commit 13d61f97c9

View File

@ -428,7 +428,8 @@ class vmmEngine(gobject.GObject):
except KeyboardInterrupt:
raise
except libvirt.libvirtError, e:
if e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR:
if (e.get_error_domain() == libvirt.VIR_FROM_REMOTE and
e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR):
logging.exception("Could not refresh connection %s." % uri)
logging.debug("Closing connection since libvirtd "
"appears to have stopped.")