]> xenbits.xensource.com Git - libvirt.git/commit
nodedev: check/add for scsi_host caps for ListDevices
authorShivaprasad G Bhat <shivaprasadbhat@gmail.com>
Tue, 3 Feb 2015 11:55:16 +0000 (06:55 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 5 Feb 2015 12:50:24 +0000 (07:50 -0500)
commite8fcac8ecb3fcd5078300b42a4940fb53b42603d
treeac2b45dace395b9eeb9d82d0d646f59cd726857d
parent1b2c9ce752b02fed4deabf91c534989ec8193071
nodedev: check/add for scsi_host caps for ListDevices

Commit id '652a2ec6' introduced two new node device capability flags
and the ability to use those flags as a way to search for a specific
subset of a 'scsi_host' device - namely a 'fc_host' and/or 'vports'.
The code modified the virNodeDeviceCapMatch whichs allows for searching
using the 'virsh nodedev-list [cap]' via virConnectListAllNodeDevices.

However, the original patches did not account for other searches for
the same capability key from virNodeListDevices using virNodeDeviceHasCap.
Since 'fc_host' and 'vports' are self defined bits of a 'scsi_host'
device mere string comparison against the basic/root type is not
sufficient.

This patch adds the check for the 'fc_host' and 'vports' bits within
a 'scsi_host' device and allows the following python code to find the
capabilities for the device:

import libvirt
conn = libvirt.openReadOnly('qemu:///system')
fc = conn.listDevices('fc_host', 0)
print(fc)
fc = conn.listDevices('vports', 0)
print(fc)

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
src/conf/node_device_conf.c