summaryrefslogtreecommitdiffstats
path: root/libvirt-override-virDomainSnapshot.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-06-09 09:55:36 -0600
committerEric Blake <eblake@redhat.com>2012-06-19 13:50:03 -0600
commitcb8fb3d06281dc1c56bd8438f8d8a3b82ca95bcc (patch)
tree8b0a1edd073bdd92b7ad4295eff228c3f4a8c37f /libvirt-override-virDomainSnapshot.py
parent7beedf6c6330c8ea5aa8e3d2d31c13e1cc7b780d (diff)
downloadlibvirt-python-v6-cb8fb3d06281dc1c56bd8438f8d8a3b82ca95bcc.tar.gz
libvirt-python-v6-cb8fb3d06281dc1c56bd8438f8d8a3b82ca95bcc.tar.xz
libvirt-python-v6-cb8fb3d06281dc1c56bd8438f8d8a3b82ca95bcc.zip
list: provide python bindings for snapshotsv0.9.13-rc2v0.9.13-rc1v0.9.13
This adds support for the new virDomainListAllSnapshots (a domain function) and virDomainSnapshotListAllChildren (a snapshot function) to the libvirt-python bindings. The implementation is done manually as the generator does not support wrapping lists of C pointers into python objects. * python/libvirt-override.c (libvirt_virDomainListAllSnapshots) (libvirt_virDomainSnapshotListAllChildren): New functions. * python/libvirt-override-api.xml: Document them. * python/libvirt-override-virDomain.py (listAllSnapshots): New file. * python/libvirt-override-virDomainSnapshot.py (listAllChildren): Likewise. * python/Makefile.am (CLASSES_EXTRA): Ship them.
Diffstat (limited to 'libvirt-override-virDomainSnapshot.py')
-rw-r--r--libvirt-override-virDomainSnapshot.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/libvirt-override-virDomainSnapshot.py b/libvirt-override-virDomainSnapshot.py
new file mode 100644
index 0000000..3da7bfd
--- /dev/null
+++ b/libvirt-override-virDomainSnapshot.py
@@ -0,0 +1,11 @@
+ def listAllChildren(self, flags):
+ """List all child snapshots and returns a list of snapshot objects"""
+ ret = libvirtmod.virDomainSnapshotListAllChildren(self._o, flags)
+ if ret is None:
+ raise libvirtError("virDomainSnapshotListAllChildren() failed", conn=self)
+
+ retlist = list()
+ for snapptr in ret:
+ retlist.append(virDomainSnapshot(self, _obj=snapptr))
+
+ return retlist