summaryrefslogtreecommitdiffstats
path: root/libvirt-override-virStream.py
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2009-07-10 12:18:12 +0100
committerDaniel P. Berrange <berrange@redhat.com>2009-09-29 15:48:52 +0100
commitf444dc0597044265a7585d94c3a19875ded35cac (patch)
tree0efc1d6f4bf1be7859cccfecf17e59b064b9fa02 /libvirt-override-virStream.py
parent4588a49e12675a0d74407d846cf763ecd941abec (diff)
downloadlibvirt-python-v6-f444dc0597044265a7585d94c3a19875ded35cac.tar.gz
libvirt-python-v6-f444dc0597044265a7585d94c3a19875ded35cac.tar.xz
libvirt-python-v6-f444dc0597044265a7585d94c3a19875ded35cac.zip
Add public API definition for data stream handling
* include/libvirt/libvirt.h.in: Public API contract for virStreamPtr object * src/libvirt_public.syms: Export data stream APIs * src/libvirt_private.syms: Export internal helper APIs * src/libvirt.c: Data stream API driver dispatch * src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr object * src/driver.h: Define internal driver API for streams * .x-sc_avoid_write: Ignore src/libvirt.c because it trips up on comments including write() * python/Makefile.am: Add libvirt-override-virStream.py * python/generator.py: Add rules for virStreamPtr class * python/typewrappers.h, python/typewrappers.c: Wrapper for virStreamPtr * docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate with new APIs
Diffstat (limited to 'libvirt-override-virStream.py')
-rw-r--r--libvirt-override-virStream.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/libvirt-override-virStream.py b/libvirt-override-virStream.py
new file mode 100644
index 0000000..f50a7ef
--- /dev/null
+++ b/libvirt-override-virStream.py
@@ -0,0 +1,20 @@
+ def __del__(self):
+ try:
+ if self.cb:
+ libvirtmod.virStreamEventRemoveCallback(self._o)
+ except AttributeError:
+ pass
+
+ if self._o != None:
+ libvirtmod.virStreamFree(self._o)
+ self._o = None
+
+ def eventAddCallback(self, cb, opaque):
+ """ """
+ try:
+ self.cb = cb
+ self.opaque = opaque
+ ret = libvirtmod.virStreamEventAddCallback(self._o, self)
+ if ret == -1: raise libvirtError ('virStreamEventAddCallback() failed', conn=self._conn)
+ except AttributeError:
+ pass