summaryrefslogtreecommitdiffstats
path: root/libvirt-override-virConnect.py
diff options
context:
space:
mode:
authorAdam Litke <agl@us.ibm.com>2011-07-22 13:57:42 +0800
committerDaniel Veillard <veillard@redhat.com>2011-07-22 13:57:42 +0800
commitaf0c40df6c960076ad8b148595a73ee1015fe2de (patch)
tree18582fa00d4a1cdfa59a734113d384b13736ae5d /libvirt-override-virConnect.py
parent3d3872d29da204cdf8e9503f090029e8b5aa88ba (diff)
downloadlibvirt-python-v6-af0c40df6c960076ad8b148595a73ee1015fe2de.tar.gz
libvirt-python-v6-af0c40df6c960076ad8b148595a73ee1015fe2de.tar.xz
libvirt-python-v6-af0c40df6c960076ad8b148595a73ee1015fe2de.zip
Asynchronous event for BlockJob completion
When an operation started by virDomainBlockPull completes (either with success or with failure), raise an event to indicate the final status. This API allow users to avoid polling on virDomainGetBlockJobInfo if they would prefer to use an event mechanism. * daemon/remote.c: Dispatch events to client * include/libvirt/libvirt.h.in: Define event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle the new event * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block_stream completion and emit a libvirt block pull event * src/remote/remote_driver.c: Receive and dispatch events to application * src/remote/remote_protocol.x: Wire protocol definition for the event * src/remote_protocol-structs: structure definitions for protocol verification * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event from QEMU monitor
Diffstat (limited to 'libvirt-override-virConnect.py')
-rw-r--r--libvirt-override-virConnect.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py
index eeeedf9..65b5342 100644
--- a/libvirt-override-virConnect.py
+++ b/libvirt-override-virConnect.py
@@ -113,6 +113,18 @@
authScheme, subject, opaque)
return 0
+ def dispatchDomainEventBlockPullCallback(self, dom, path, type, status, cbData):
+ """Dispatches events to python user domain blockJob event callbacks
+ """
+ try:
+ cb = cbData["cb"]
+ opaque = cbData["opaque"]
+
+ cb(self, virDomain(self, _obj=dom), path, type, status, opaque)
+ return 0
+ except AttributeError:
+ pass
+
def domainEventDeregisterAny(self, callbackID):
"""Removes a Domain Event Callback. De-registering for a
domain callback will disable delivery of this event type """