connection: Avoid some useless errors when connection closes

- Run the connection
- Restart libvirtd, connection is auto closed
- Re-run the connection
- Manually stop it, see errors in the logs about unknown event IDs

We need to unconditionally clear our event ID list
This commit is contained in:
Cole Robinson 2014-04-16 12:23:57 -04:00
parent 1f7604b241
commit 873c22d19a

View File

@ -973,14 +973,14 @@ class vmmConnection(vmmGObject):
if not self._backend.is_closed():
for eid in self._domain_cb_ids:
self._backend.domainEventDeregisterAny(eid)
self._domain_cb_ids = []
for eid in self._network_cb_ids:
self._backend.networkEventDeregisterAny(eid)
self._network_cb_ids = []
except:
logging.debug("Failed to deregister events in conn cleanup",
exc_info=True)
finally:
self._domain_cb_ids = []
self._network_cb_ids = []
self._backend.close()
self.record = []