mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-16 18:25:02 -06:00
engine: Make sure a libvirtd restart doesn't lock the app
We were trying to close the connection without thread locking (and closing can emit a signal which updates the UI).
This commit is contained in:
parent
4075899085
commit
d74e01155d
@ -211,8 +211,9 @@ class vmmEngine(gobject.GObject):
|
||||
|
||||
def _tick(self):
|
||||
for uri in self.connections.keys():
|
||||
conn = self.connections[uri]["connection"]
|
||||
try:
|
||||
self.connections[uri]["connection"].tick()
|
||||
conn.tick()
|
||||
except KeyboardInterrupt:
|
||||
raise
|
||||
except libvirt.libvirtError, e:
|
||||
@ -220,7 +221,7 @@ class vmmEngine(gobject.GObject):
|
||||
logging.exception("Could not refresh connection %s." % uri)
|
||||
logging.debug("Closing connection since libvirtd "
|
||||
"appears to have stopped.")
|
||||
self.connections[uri]["connection"].close()
|
||||
gobject.idle_add(conn.close)
|
||||
else:
|
||||
raise
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user