Neel Basu
2015-Mar-27 07:21 UTC
[libvirt-users] Channel Device virConnectListAllNodeDevices
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.
Neel Basu
2015-Mar-27 11:34 UTC
Re: [libvirt-users] Channel Device virConnectListAllNodeDevices
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@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. > >
Possibly Parallel Threads
- virConnectListAllNodeDevices requires number of devices to be known
- [PATCH node-image] add livecd-iso-to-iscsi script to support iscsi root booting setup
- Questions regarding hostdev scsi
- [PATCH 17/18] virtiofs: Remove TODO to quiesce/end_requests
- pointer to "spice" device by virNodeDeviceLookupByName