summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJiri Denemark <jdenemar@redhat.com>2016-03-08 16:47:49 +0100
committerJiri Denemark <jdenemar@redhat.com>2016-03-08 16:47:49 +0100
commit34363876278732ff9dbcccfda01d4d7b7d95b18c (patch)
tree06060ad14396fda602fc7b235e945ba68cff8810 /examples
parent1bba3ca4e250c20b63515085f7be4b2c8ec5e237 (diff)
downloadlibvirt-python-34363876278732ff9dbcccfda01d4d7b7d95b18c.tar.gz
Add support for JOB_COMPLETED event
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/event-test.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/event-test.py b/examples/event-test.py
index 615f86c..5be4978 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -533,6 +533,8 @@ def myDomainEventDeviceAddedCallback(conn, dom, dev, opaque):
def myDomainEventMigrationIteration(conn, dom, iteration, opaque):
print("myDomainEventMigrationIteration: Domain %s(%s) started migration iteration %d" % (
dom.name(), dom.ID(), iteration))
+def myDomainEventJobCompletedCallback(conn, dom, params, opaque):
+ print("myDomainEventJobCompletedCallback: Domain %s(%s) %s" % (dom.name(), dom.ID(), params))
##########################################################################
# Network events
@@ -646,6 +648,7 @@ def main():
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE, myDomainEventAgentLifecycleCallback, None)
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_DEVICE_ADDED, myDomainEventDeviceAddedCallback, None)
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION, myDomainEventMigrationIteration, None)
+ vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_JOB_COMPLETED, myDomainEventJobCompletedCallback, None)
vc.networkEventRegisterAny(None, libvirt.VIR_NETWORK_EVENT_ID_LIFECYCLE, myNetworkEventLifecycleCallback, None)