mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-01 00:21:59 +03:00
list: Expose virConnectListAllNodeDevices 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-virConnect.py: * Implementation for listAllNodeDevices. python/libvirt-override.c: Implementation for the wrapper.
This commit is contained in:
@ -242,3 +242,15 @@
|
||||
retlist.append(virInterface(self, _obj=ifaceptr))
|
||||
|
||||
return retlist
|
||||
|
||||
def listAllDevices(self, flags):
|
||||
"""Returns a list of host node device objects"""
|
||||
ret = libvirtmod.virConnectListAllNodeDevices(self._o, flags)
|
||||
if ret is None:
|
||||
raise libvirtError("virConnectListAllNodeDevices() failed", conn=self)
|
||||
|
||||
retlist = list()
|
||||
for devptr in ret:
|
||||
retlist.append(virNodeDevice(self, _obj=devptr))
|
||||
|
||||
return retlist
|
||||
|
Reference in New Issue
Block a user