Re: Channel Device virConnectListAllNodeDevices

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

 



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@xxxxxxxxx> 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.


_______________________________________________
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