Discussion:
[PATCH 00/13] Querying disk rotation speed and link type
Gris Ge
2016-02-17 13:22:14 UTC
Permalink
Hightlights:

* Query local disk rotation speed -- `lsm_scsi_rpm_of_disk_path()`.
* Query local disk link type -- `lsm_scsi_link_type_of_disk_path()`.
* Use macro _wrapper() to remove duplicate code in `_scsi_clib.c`.
* New lsmcli command -- `lsmcli lsd` to list all local scsi disks.

FAQ:
* Why not use udev for RPM which does not need root privilege?

Udev does not support SAS disk RPM query yet.
Should we create a patch to udev or use this SCSI standard way?

* Why need root privilege?

Required by SGIO IOCTL.
If kernel could expose more VPD pages (like 0xb1and 0x00) via sysfs like
they do for VPD 0x83, we don't need to do SGIO any more.

* Why create your own SGIO function instead of using libsgutils2?

IMHO, libsgutils2 is too heavy for our simple use here and SGIO is not that
complex.

Please check github pull request for detail:
https://github.com/libstorage/libstoragemgmt/pull/85

Thank you!

Gris Ge (13):
Constants Test: Add support of negative number and all uppercase
module.
Constants test: fix incorrect hex constant parsing.
C API: New library method to query disk rotation speed.
Python API: New library method to query disk rotation speed.
lsmcli: Add new command to list local SCSI disks.
Test: Fix running make check by root user.
Test: Add test case for SCSI disk rotation speed.
Improve lsm_scsi_vpd83_of_disk_path().
C library level API: Query disk link type.
Python library level API: Query disk link type.
C unit test: Add test case for disk link type query.
lsmcli: Include disk link type in 'local-scsi-disk-list' command.
C API: Use macro _good() to replace duplicate code

.../include/libstoragemgmt/libstoragemgmt_error.h | 3 +
.../include/libstoragemgmt/libstoragemgmt_scsi.h | 96 ++++
c_binding/lsm_scsi.c | 610 ++++++++++++++++++---
doc/man/lsmcli.1.in | 7 +
python_binding/lsm/_common.py | 1 +
python_binding/lsm/_scsi.py | 116 +++-
python_binding/lsm/_scsi_clib.c | 265 ++++-----
test/cmdtest.py | 9 +
test/test_include.sh | 8 +
test/tester.c | 68 ++-
tools/lsmcli/cmdline.py | 85 ++-
tools/lsmcli/data_display.py | 47 +-
tools/utility/check_const.pl | 17 +-
13 files changed, 1089 insertions(+), 243 deletions(-)
--
2.7.1
Loading...