[PATCH 0/7] API rename: lsm_scsi_xxx to lsm_local_disk_xxx and other fixes.
by Gris Ge
Rename lsm_scsi_xxx to lsm_local_disk_xxx as we support ATA protocol disks also.
In the future, we might also support NVMe disks as well.
Include other fixes:
* Fix constant check.
* Eliminate duplicate code by using some C macros.
* Split large functions to smaller one in lsm_scsi_vpd83_of_disk_path().
Please check github pull request for detail:
https://github.com/libstorage/libstoragemgmt/pull/92
Gris Ge (7):
Constants Test: Add support of negative number and all uppercase
module.
Constants test: fix incorrect hex constant parsing.
Test: Fix running make check by root user.
Improve lsm_scsi_vpd83_of_disk_path().
C API: Use macro _good() to replace duplicate code
Python C extension: Eliminate duplicate code.
API rename: lsm_scsi_xxx to lsm_local_disk_xxx.
c_binding/Makefile.am | 2 +-
c_binding/include/libstoragemgmt/Makefile.am | 2 +-
c_binding/include/libstoragemgmt/libstoragemgmt.h | 2 +-
.../include/libstoragemgmt/libstoragemgmt_disk.h | 2 +-
.../libstoragemgmt/libstoragemgmt_local_disk.h | 79 +++
.../include/libstoragemgmt/libstoragemgmt_scsi.h | 77 ---
c_binding/lsm_local_disk.c | 760 +++++++++++++++++++++
c_binding/lsm_scsi.c | 615 -----------------
packaging/libstoragemgmt.spec.in | 4 +-
plugin/hpsa/hpsa.py | 4 +-
python_binding/Makefile.am | 14 +-
python_binding/lsm/__init__.py | 2 +-
python_binding/lsm/_clib.c | 181 +++++
python_binding/lsm/_local_disk.py | 87 +++
python_binding/lsm/_scsi.py | 86 ---
python_binding/lsm/_scsi_clib.c | 221 ------
test/test_include.sh | 14 +-
test/tester.c | 114 ++--
tools/lsmcli/cmdline.py | 4 +-
tools/utility/check_const.pl | 18 +-
20 files changed, 1204 insertions(+), 1084 deletions(-)
create mode 100644 c_binding/include/libstoragemgmt/libstoragemgmt_local_disk.h
delete mode 100644 c_binding/include/libstoragemgmt/libstoragemgmt_scsi.h
create mode 100644 c_binding/lsm_local_disk.c
delete mode 100644 c_binding/lsm_scsi.c
create mode 100644 python_binding/lsm/_clib.c
create mode 100644 python_binding/lsm/_local_disk.py
delete mode 100644 python_binding/lsm/_scsi.py
delete mode 100644 python_binding/lsm/_scsi_clib.c
--
2.7.1
8 years, 2 months
[PATCH 00/13] Querying disk rotation speed and link type
by Gris Ge
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
8 years, 2 months