mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-11 16:05:51 -06:00
Don't close connection on all libvirt errors: only if libvirtd goes away.
This commit is contained in:
parent
9fe564e14b
commit
3d22dbf020
@ -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)
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user