Product SiteDocumentation Site

7.3.2. Alternative method of enumerating interfaces

It is also possible to get a list of interfaces from the virNodeDevice API. Calling virNodeListDevices with the "cap" argument (capabilities) set to "net". This will return a list of device names (each starting with "net_"), and those device names can, in turn, be sent through virNodeDeviceLookupByName, then virNodeDeviceGetXMLDesc to get an XML string containing the interfaces' names, mac addresses, and 802.11 vs. 802.03 status (wired vs wireless). See section 4.6 for more information and examples of using virNodeDevice functions for this purpose.