mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-03 08:21:58 +03:00
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.
This commit is contained in:
11
libvirt-override-virStoragePool.py
Normal file
11
libvirt-override-virStoragePool.py
Normal file
@ -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
|
Reference in New Issue
Block a user