[libvirt] [PATCH] check "fc_host" and "vport_ops" capabilities in SCSI host nodedevs

John Ferlan jferlan at redhat.com
Wed Feb 4 13:55:34 UTC 2015



On 02/03/2015 03:59 PM, John Ferlan wrote:
> 
> 
> On 02/03/2015 06:55 AM, Shivaprasad G Bhat wrote:
>> fc_host & vport_ops devices are SCSI devices with additional capabilities.
>> Mere string comparison of basic types is not sufficient in this case. This
>> patch introduces additional capability checks for SCSI devices if the user
>> is looking to list 'fc_host' or 'vport_ops' devices.
>>
>> Signed-off-by: Shivaprasad G Bhat <sbhat at linux.vnet.ibm.com>
>> ---
>>  src/conf/node_device_conf.c |    8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
> 
> While this does work and more or less follows what was done for
> virNodeDeviceCapMatch, I'm wondering if the 'fc_host' and 'vports_ops'
> capabilities need to also be returned in a "list" of capabilities for a
> node device
> 
> That is I see that virNodeDeviceListCaps() seems to be only returning 1
> capability for every device. However, for the scsi_host, it has those
> additional fc_host and vport_ops capabilities which if returned in the
> list would then be "found" by the python listDevices code which for some
> devices (like the scsi_host here) there may be more than one way to "get
> at" the information.
> 
> I'm investigating whether modifying nodeDeviceListCaps() in
> src/node_device/node_device_driver.c to add "fc_host" and "vport_ops" to
> the return caps_list will resolve the issue...  This also means
> virNodeDeviceNumOfCaps() (and it's driver API nodeDeviceNumOfCaps) will
> need some tweaking too.
> 
> Another option would be to fix the libvirt-python code to use
> ListAllDevices with the flags argument like virsh does.
> 
> John
<...snip...>

As it turns out your patch will be required in order to cover the
virNodeListDevices case as well as the attached patch in order to cover
the virNodeDeviceNumOfCaps and virNodeDeviceListCaps cases.

Could you take a look at the attached code and try it out on your system
to make sure it does what I expect (the system I use to test these types
of checks is unavailable at the moment).  What should happen is for
'scsi_host' devices with 'fc_host' and/or 'vports' capability types -
the cap_list returned will be larger than 1. The code currently only has
ever returned 1 element. The patch also lists the sample python which
should work.

With your successful test, I'll push the patches (although I'm tweaking
your commit message a bit - it'll be very similar to the attached patch
commit message).

Thanks -

John


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-nodedev-check-add-for-scsi_host-caps-for-NumOfCaps-a.patch
Type: text/x-patch
Size: 3409 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150204/87215ee0/attachment-0001.bin>


More information about the libvir-list mailing list