summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2014-03-10 09:33:04 -0400
committerCole Robinson <crobinso@redhat.com>2014-03-10 09:35:35 -0400
commit081e34715ffa5a210e1e0c8670fe3a1a3ec5180b (patch)
treed3c69ed7e89c574a1bd8c5df8da9c5bb5fd43ef9
parentcfc52051b71bcfbf3f58ea6eddf457298f186727 (diff)
downloadvirt-manager-081e34715ffa5a210e1e0c8670fe3a1a3ec5180b.tar.gz
connection: Handle errors when deregistering events on close (bz 1069351)
Otherwise this interrupts the close/cleanup routine, and the connection never appears to disconnect in the UI. This causes error dialog spamming when libvirtd goes down.
-rw-r--r--virtManager/connection.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 57e143d7..4c034b83 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -929,16 +929,25 @@ class vmmConnection(vmmGObject):
def close(self):
def cleanup(devs):
for dev in devs.values():
- dev.cleanup()
-
- if not self._backend.is_closed():
- if self._domain_cb_id is not None:
- self._backend.domainEventDeregisterAny(self._domain_cb_id)
- self._domain_cb_id = None
+ try:
+ dev.cleanup()
+ except:
+ logging.debug("Failed to cleanup %s", exc_info=True)
- if self._network_cb_id is not None:
- self._backend.networkEventDeregisterAny(self._network_cb_id)
- self._network_cb_id = None
+ try:
+ if not self._backend.is_closed():
+ if self._domain_cb_id is not None:
+ self._backend.domainEventDeregisterAny(
+ self._domain_cb_id)
+ self._domain_cb_id = None
+
+ if self._network_cb_id is not None:
+ self._backend.networkEventDeregisterAny(
+ self._network_cb_id)
+ self._network_cb_id = None
+ except:
+ logging.debug("Failed to deregister events in conn cleanup",
+ exc_info=True)
self._backend.close()
self.record = []