open-iscsi / rtslib-fb

Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
Apache License 2.0
72 stars 90 forks source link

Add ability to set T10 Vendor ID on backstore #149

Open os-d opened 5 years ago

os-d commented 5 years ago

Signed-off-by: Oliver Smith-Denny oliver@oliversmith-denny.com

David Disseldorp's kernel patch (https://patchwork.kernel.org/patch/10707421/) added the ability to set the T10 vendor ID for a backstore in ConfigFS. This patch give rtslib-fb the functionality to set that vendor ID at backstore creation time. There is also a pending PR in targetcli-fb to match this functionality on the UI side.

Please give me your comments, I am happy to make any changes. I set this ability for ramdisks and block storage as those are my two use cases. PSCSI already has the ability to get the vendor and a vendor ID seemed to make less sense for FileIO, although that easily could be added. I only let the vendor ID be set at backstore creation time, as it is unlikely the vendor would change throughout the lifetime of the backstore (this could also be changed).

I tested with a new kernel that include's the above patch and I tested on a kernel without the patch. I also tested that saveconfig and restoreconfig work as expected on both kernels, when the vendor ID is present in the json file and when it is not. My test results showed no crashes and the vendor ID being properly displayed on the newer kernel.