libvirt/python/libvirt-override-virStoragePool.py
Osier Yang fa2e35a336 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.
2012-09-10 10:41:18 +08:00

12 lines
436 B
Python

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