# HG changeset patch # User Cole Robinson # Date 1253131339 14400 # Node ID 1c886d1863f72e7ddd5fb99050362296be6a9deb # Parent 9242a7fe76b16c6505bdd3d3d328ae8f0c56da10 Don't close connection on all libvirt errors: only if libvirtd goes away. Index: virt-manager-0.8.0/src/virtManager/connection.py =================================================================== --- virt-manager-0.8.0.orig/src/virtManager/connection.py +++ virt-manager-0.8.0/src/virtManager/connection.py @@ -941,7 +941,15 @@ class vmmConnection(gobject.GObject): updateVMs = newVMs for uuid in updateVMs: - self.vms[uuid].tick(now) + vm = self.vms[uuid] + try: + vm.tick(now) + except libvirt.libvirtError, e: + if e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR: + raise + logging.exception("Tick for VM '%s' failed" % vm.get_name()) + except Exception, e: + logging.exception("Tick for VM '%s' failed" % vm.get_name()) if not noStatsUpdate: self._recalculate_stats(now) Index: virt-manager-0.8.0/src/virtManager/engine.py =================================================================== --- virt-manager-0.8.0.orig/src/virtManager/engine.py +++ virt-manager-0.8.0/src/virtManager/engine.py @@ -199,10 +199,14 @@ class vmmEngine(gobject.GObject): self.connections[uri]["connection"].tick() except KeyboardInterrupt: raise - except: - logging.exception("Could not refresh connection %s." % uri) - logging.debug("Closing connection since refresh failed.") - self.connections[uri]["connection"].close() + except libvirt.libvirtError, e: + if 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.") + self.connections[uri]["connection"].close() + else: + raise return 1 def change_timer_interval(self,ignore1,ignore2,ignore3,ignore4):