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:
Cole Robinson 2010-01-26 12:24:33 -05:00
parent 4075899085
commit d74e01155d

View File

@ -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