Re: virConnectListAllNodeDevices requires number of devices to be known

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/26/2015 04:05 PM, Neel Basu wrote:
> Hi,
> virConnectListAllNodeDevices() takes a virNodeDevicePtr **devices. So
> I need to create an array of virNodeDevicePtr. For that I need to know
> size / Number of devices. What is the function for that ?

No, that is incorrect.

http://www.libvirt.org/html/libvirt-libvirt-nodedev.html#virConnectListAllNodeDevices

virConnectListAllNodeDevices() 1) allocates the memory for you (you must
later free it with iterated calls to virNodeDeviceFree()), and 2) the
return value of the API is the number of node devices that were found
(i.e. how many elements are in the array), or -1 if there was an error.

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users




[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux