[libvirt-users] Channel Device virConnectListAllNodeDevices

Neel Basu neel.basu.z at gmail.com
Fri Mar 27 11:34:20 UTC 2015


sorry I just realized that virConnectListAllNodeDevices() returns devices
of host machine.

virDomainGetXMLDesc() returns full xml of the requested domain. But with
this the only way to extract channel devices is to parse the entire xml
document. Is there any other way like iterating devices of a domain ?

Thank You.

On Fri, Mar 27, 2015 at 12:51 PM, Neel Basu <neel.basu.z at gmail.com> wrote:

> Hello,
> I've added a Channel Device through virt-manager GUI. virsh dumpxml shows
> the device as.
>
> <channel type='unix'>
>       <source mode='bind'
> path='/var/lib/libvirt/qemu/channel/target/ubuntusaucy.marx'/>
>       <target type='virtio' name='marx'/>
>       <alias name='channel2'/>
>       <address type='virtio-serial' controller='0' bus='0' port='3'/>
>     </channel>
>
> I am expecting virConnectListAllNodeDevices to have the device in its
> output. But I don't see it there. Is it the right function to call ?
>
> virNodeDevicePtr* devices;
> int dev_count = virConnectListAllNodeDevices(conn, &devices, 0);
> std::cout << "Devices: " << dev_count << std::endl;
> for(virNodeDevicePtr* device = devices; device < devices+dev_count;
> ++device){
>       std::cout << virNodeDeviceGetName(*device) << std::endl;
> }
>
> returns 66 devices but once I loop through devices I don't get any
> corresponding name for the channel device.
>
> Tried using
>
> virConnectListAllNodeDevices(conn, &devices,
> VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS);
>
> returns 0 devices.
>
> Thanks.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150327/e09b84ab/attachment.htm>


More information about the libvirt-users mailing list