[virt-tools-list] [virt-manager] [PATCH v2 1/4] connection: Add callback parameter for function _add_domain_xml_event
Lin Ma
lma at suse.com
Wed Jul 4 08:10:35 UTC 2018
Further patches will pass in the callback instead of the default one.
Signed-off-by: Lin Ma <lma at suse.com>
---
virtManager/connection.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 76e78c49..8efcca77 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -848,14 +848,16 @@ class vmmConnection(vmmGObject):
self.using_domain_events = False
logging.debug("Error registering domain events: %s", e)
- def _add_domain_xml_event(eventname, eventval):
+ def _add_domain_xml_event(eventname, eventval, cb=None):
if not self.using_domain_events:
return
+ if not cb:
+ cb = self._domain_xml_misc_event
try:
eventid = getattr(libvirt, eventname, eventval)
self._domain_cb_ids.append(
self.get_backend().domainEventRegisterAny(
- None, eventid, self._domain_xml_misc_event, eventname))
+ None, eventid, cb, eventname))
except Exception as e:
logging.debug("Error registering %s event: %s",
eventname, e)
--
2.15.1
More information about the virt-tools-list
mailing list