summaryrefslogtreecommitdiffstats
path: root/libvirt-override-virConnect.py
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-07-13 17:05:17 +0800
committerGuannan Ren <gren@redhat.com>2012-07-14 16:02:26 +0800
commit49759db34e7cb65a431c66d0d9a14af5f809d09b (patch)
treecfde89ba703a6481908b948a763f801a24b2136f /libvirt-override-virConnect.py
parentcb8fb3d06281dc1c56bd8438f8d8a3b82ca95bcc (diff)
downloadlibvirt-python-split-49759db34e7cb65a431c66d0d9a14af5f809d09b.tar.gz
libvirt-python-split-49759db34e7cb65a431c66d0d9a14af5f809d09b.tar.xz
libvirt-python-split-49759db34e7cb65a431c66d0d9a14af5f809d09b.zip
Define public API for receiving guest memory balloon events
When the guest changes its memory balloon applications may want to know what the new value is, without having to periodically poll on XML / domain info. Introduce a "balloon change" event to let apps see this * include/libvirt/libvirt.h.in: Define the virConnectDomainEventBalloonChangeCallback callback and VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE constant * python/libvirt-override-virConnect.py, python/libvirt-override.c: Wire up helpers for new event * daemon/remote.c: Helper for serializing balloon event * examples/domain-events/events-c/event-test.c, examples/domain-events/events-python/event-test.py: Add example of balloon event usage * src/conf/domain_event.c, src/conf/domain_event.h: Handling of balloon events * src/remote/remote_driver.c: Add handler of balloon events * src/remote/remote_protocol.x: Define wire protocol for balloon events * src/remote_protocol-structs: Likewise. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'libvirt-override-virConnect.py')
-rw-r--r--libvirt-override-virConnect.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py
index ecb5680..50177ab 100644
--- a/libvirt-override-virConnect.py
+++ b/libvirt-override-virConnect.py
@@ -161,6 +161,15 @@
cb(self, virDomain(self, _obj=dom), reason, opaque)
return 0;
+ def _dispatchDomainEventBalloonChangeCallback(self, dom, actual, cbData):
+ """Dispatches events to python user domain balloon change event callbacks
+ """
+ cb = cbData["cb"]
+ opaque = cbData["opaque"]
+
+ cb(self, virDomain(self, _obj=dom), actual, opaque)
+ return 0
+
def domainEventDeregisterAny(self, callbackID):
"""Removes a Domain Event Callback. De-registering for a
domain callback will disable delivery of this event type """