summaryrefslogtreecommitdiffstats
path: root/libvirt-override-virStoragePool.py
diff options
context:
space:
mode:
authorOsier Yang <jyang@redhat.com>2012-09-04 23:32:58 +0800
committerOsier Yang <jyang@redhat.com>2012-09-10 10:41:18 +0800
commit9b64533be6efc412f6daf9461a3fc0301c351be3 (patch)
treeab3a018eaaaf11ac61512426a31273f607138a1c /libvirt-override-virStoragePool.py
parentcc4225c8aceaeb0be9b7a04393f780ecc67ad5f4 (diff)
downloadlibvirt-python-split-9b64533be6efc412f6daf9461a3fc0301c351be3.tar.gz
libvirt-python-split-9b64533be6efc412f6daf9461a3fc0301c351be3.tar.xz
libvirt-python-split-9b64533be6efc412f6daf9461a3fc0301c351be3.zip
list: Expose virStoragePoolListAllVolumes to Python binding
The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virStoragePool.py: * New file, includes implementation of listAllVolumes. python/libvirt-override.c: Implementation for the wrapper.
Diffstat (limited to 'libvirt-override-virStoragePool.py')
-rw-r--r--libvirt-override-virStoragePool.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/libvirt-override-virStoragePool.py b/libvirt-override-virStoragePool.py
new file mode 100644
index 0000000..ffe160c
--- /dev/null
+++ b/libvirt-override-virStoragePool.py
@@ -0,0 +1,11 @@
+ def listAllVolumes(self, flags):
+ """List all storage volumes and returns a list of storage volume objects"""
+ ret = libvirtmod.virStoragePoolListAllVolumes(self._o, flags)
+ if ret is None:
+ raise libvirtError("virStoragePoolListAllVolumes() failed", conn=self)
+
+ retlist = list()
+ for volptr in ret:
+ retlist.append(virStorageVol(self, _obj=volptr))
+
+ return retlist