libvirt/src/node_device
John Ferlan f44ec9c1ab nodedev: check/add for scsi_host caps for NumOfCaps and ListCaps
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 virNodeDeviceNumOfCaps and virNodeDeviceListCaps
using nodeDeviceNumOfCaps and nodeDeviceListCaps. 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')
devs = conn.listAllDevices()
for dev in devs:
    if 'fc_host' in dev.listCaps() or 'vports' in dev.listCaps():
        print dev.name(),dev.numOfCaps(),dev.listCaps()
2015-02-05 07:50:32 -05:00
..
node_device_driver.c nodedev: check/add for scsi_host caps for NumOfCaps and ListCaps 2015-02-05 07:50:32 -05:00
node_device_driver.h Remove use of nodeDevicePrivateData from nodeDev driver 2015-01-27 12:02:03 +00:00
node_device_hal.c Removing probing of secondary drivers 2015-01-27 12:02:04 +00:00
node_device_hal.h
node_device_linux_sysfs.c Transform VIR_ERROR into VIR_WARN in detect_scsi_host_caps 2014-11-07 16:44:48 +01:00
node_device_udev.c Removing probing of secondary drivers 2015-01-27 12:02:04 +00:00
node_device_udev.h