diff --git a/.gitignore b/.gitignore index 9f7c5a1..36a2744 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /libstoragemgmt-1.3.2.tar.gz /libstoragemgmt-1.3.5.tar.gz /libstoragemgmt-1.4.0.tar.gz +/libstoragemgmt-1.5.0.tar.gz diff --git a/0001-udev-Fix-gcc-warning-on-non-x86-platform.patch b/0001-udev-Fix-gcc-warning-on-non-x86-platform.patch deleted file mode 100644 index 5c4717a..0000000 --- a/0001-udev-Fix-gcc-warning-on-non-x86-platform.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 2a2d9a8200f987b42966ab4e96b7769b8f9a159f Mon Sep 17 00:00:00 2001 -From: Gris Ge -Date: Wed, 22 Feb 2017 16:18:20 +0800 -Subject: [PATCH] udev: Fix gcc warning on non-x86 platform. - -Issue: - Got failure on s390x: - - scan-scsi-target.c:90:2: error: comparison is always true due to limited - range of data type [-Werror=type-limits] - -Root cause: - The error is on these lines: - - char c; - ... - while ((c = getopt_long(argc, argv, "rh", longopts, NULL)) != -1) { - - On non-x86 platform, char is unsigned. Which makes the (c != -1) - always true. - -Fix: - Take return of getopt_long() as int. - -Signed-off-by: Gris Ge ---- - tools/udev/scan-scsi-target.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/udev/scan-scsi-target.c b/tools/udev/scan-scsi-target.c -index bb83c65..00126b9 100644 ---- a/tools/udev/scan-scsi-target.c -+++ b/tools/udev/scan-scsi-target.c -@@ -54,7 +54,7 @@ static void __attribute__ ((__noreturn__)) invalid(char **argv, char *devpath) - - int main(int argc, char **argv) - { -- char c; -+ int c; - char *devpath; - - char *sysfs_path; --- -1.8.3.1 - diff --git a/0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch b/0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch deleted file mode 100644 index a88614f..0000000 --- a/0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c446179b11608a25989dea1209fe3341fe17b76d Mon Sep 17 00:00:00 2001 -From: Gris Ge -Date: Thu, 23 Feb 2017 21:41:46 +0800 -Subject: [PATCH] C library: Bug fix for incorrect use of sizeof. - - * Should use strlen() instead of sizeof() for calculate string length. - -Signed-off-by: Gris Ge ---- - c_binding/libses.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/c_binding/libses.c b/c_binding/libses.c -index a5ebb2d..3c1e8d9 100644 ---- a/c_binding/libses.c -+++ b/c_binding/libses.c -@@ -341,9 +341,9 @@ static int _ses_sg_paths_get(char *err_msg, char ***sg_paths, - (strncmp(sg_name, "sg", strlen("sg")) != 0)) - continue; - sysfs_sg_type_path = (char *) -- malloc(sizeof(char) * (sizeof(_SYSFS_SG_ROOT_PATH) + -+ malloc(sizeof(char) * (strlen(_SYSFS_SG_ROOT_PATH) + - strlen("/") + -- sizeof(sg_name) + -+ strlen(sg_name) + - strlen("/device/type") + - 1 /* trailing \0 */)); - _alloc_null_check(err_msg, sysfs_sg_type_path, rc, out); --- -1.8.3.1 - diff --git a/0003-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch b/0003-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch deleted file mode 100644 index a844b3f..0000000 --- a/0003-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch +++ /dev/null @@ -1,83 +0,0 @@ -From fa8e9e94c6d06ac135d4363293b00b1a42ebf5c4 Mon Sep 17 00:00:00 2001 -From: Gris Ge -Date: Thu, 23 Feb 2017 22:06:26 +0800 -Subject: [PATCH] Simc plugin: Fix gcc warning on fallthrough switch. - -Issue: - - GCC(gcc-7.0.1-0.9.fc26.x86_64) is warning on fallthrough switch. - -Fix: - Use if and else if check instead. - -Misc: - Don't want to mess with GCC and CLANG on this trivial issue by - using GCC extention: `__attribute__((fallthrough))`. - -Signed-off-by: Gris Ge ---- - plugin/simc/ops_v1_2.c | 38 ++++++++++++++++++-------------------- - 1 file changed, 18 insertions(+), 20 deletions(-) - -diff --git a/plugin/simc/ops_v1_2.c b/plugin/simc/ops_v1_2.c -index 3703161..3bdc2ba 100644 ---- a/plugin/simc/ops_v1_2.c -+++ b/plugin/simc/ops_v1_2.c -@@ -63,36 +63,34 @@ int volume_raid_info(lsm_plugin_ptr c, lsm_volume *volume, - _good(_str_to_int(err_msg, lsm_hash_string_get(sim_p, "member_type"), - (int *) &member_type), rc, out); - -- switch(member_type) { -- case LSM_POOL_MEMBER_TYPE_POOL: -+ if (member_type == LSM_POOL_MEMBER_TYPE_POOL) { - _good(_str_to_uint64(err_msg, lsm_hash_string_get(sim_p, - "parent_pool_id"), - &sim_p_id), rc, out); - _good(_db_sim_pool_of_sim_id(err_msg, db, sim_p_id, &sim_p), rc, out); -- case LSM_POOL_MEMBER_TYPE_DISK: -- _good(_str_to_int(err_msg, lsm_hash_string_get(sim_p, "raid_type"), -- (int *) raid_type), rc, out); -- _good(_str_to_uint32(err_msg, lsm_hash_string_get(sim_p, "strip_size"), -- strip_size), rc, out); -- *min_io_size = *strip_size; -- _good(_str_to_uint32(err_msg, lsm_hash_string_get(sim_p, "disk_count"), -- disk_count), rc, out); -- _good(_str_to_uint32(err_msg, lsm_hash_string_get(sim_p, -- "data_disk_count"), -- &data_disk_count), rc, out); -- if ((*raid_type == LSM_VOLUME_RAID_TYPE_RAID1) || -- (*raid_type == LSM_VOLUME_RAID_TYPE_JBOD)) -- *opt_io_size = _BLOCK_SIZE; -- else -- *opt_io_size = *strip_size * data_disk_count; -- break; -- default: -+ } else if (member_type != LSM_POOL_MEMBER_TYPE_DISK) { - rc = LSM_ERR_PLUGIN_BUG; - _lsm_err_msg_set(err_msg, "BUG: Got unknown pool member type %d", - member_type); - goto out; - } - -+ _good(_str_to_int(err_msg, lsm_hash_string_get(sim_p, "raid_type"), -+ (int *) raid_type), rc, out); -+ _good(_str_to_uint32(err_msg, lsm_hash_string_get(sim_p, "strip_size"), -+ strip_size), rc, out); -+ *min_io_size = *strip_size; -+ _good(_str_to_uint32(err_msg, lsm_hash_string_get(sim_p, "disk_count"), -+ disk_count), rc, out); -+ _good(_str_to_uint32(err_msg, lsm_hash_string_get(sim_p, -+ "data_disk_count"), -+ &data_disk_count), rc, out); -+ if ((*raid_type == LSM_VOLUME_RAID_TYPE_RAID1) || -+ (*raid_type == LSM_VOLUME_RAID_TYPE_JBOD)) -+ *opt_io_size = _BLOCK_SIZE; -+ else -+ *opt_io_size = *strip_size * data_disk_count; -+ - out: - _db_sql_trans_rollback(db); - if (sim_vol != NULL) --- -1.8.3.1 - diff --git a/libstoragemgmt.spec b/libstoragemgmt.spec index 6c4c8c5..48cdf18 100644 --- a/libstoragemgmt.spec +++ b/libstoragemgmt.spec @@ -2,16 +2,13 @@ %global py3_build_dir %{_builddir}/%{name}-%{version}-%{release}-python3 Name: libstoragemgmt -Version: 1.4.0 -Release: 5%{?dist} +Version: 1.5.0 +Release: 0%{?dist} Summary: Storage array management library Group: System Environment/Libraries License: LGPLv2+ URL: https://github.com/libstorage/libstoragemgmt Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz -Patch0: 0001-udev-Fix-gcc-warning-on-non-x86-platform.patch -Patch1: 0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch -Patch2: 0003-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: python3-%{name} BuildRequires: autoconf automake libtool yajl-devel libxml2-devel check-devel perl-interpreter @@ -82,7 +79,7 @@ Obsoletes: %{name}-python-clibs < %{version}-%{release} This package contains python2 client C extension libraries. -%package -n python3-%{name} +%package -n python3-%{name} Summary: Python 3 client libraries and plug-in support for %{name} Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} @@ -195,11 +192,43 @@ BuildArch: noarch The %{name}-hpsa-plugin package contains the plugin for HP SmartArray storage management via hpssacli. +%package arcconf-plugin +Summary: Files for Microsemi Adaptec and Smart Family support for %{name} +Group: System Environment/Libraries +Requires: python3-%{name} = %{version} +Requires(post): python3-%{name} = %{version} +Requires(postun): python3-%{name} = %{version} +BuildArch: noarch + +%description arcconf-plugin +The %{name}-arcconf-plugin package contains the plugin for Microsemi +Adaptec RAID and Smart Family Controller storage management. + +%package nfs-plugin +Summary: Files for NFS local filesystem support for %{name} +Group: System Environment/Libraries +Requires: python3-%{name} = %{version} +Requires(post): python3-%{name} = %{version} +Requires(postun): python3-%{name} = %{version} + +%description nfs-plugin +The nfs-plugin package contains plug-in for local NFS exports support. + +%package local-plugin +Summary: Files for local pseudo plugin of %{name} +Group: System Environment/Libraries +Requires: python3-%{name} = %{version} +Requires(post): python3-%{name} = %{version} +Requires(postun): python3-%{name} = %{version} +BuildArch: noarch + +%description local-plugin +The nfs-plugin package contains plug-in for local NFS exports support. +LibstorageMgmt local plugin allows user to manage locally storage system +without caring which real plugin(s) should be used. + %prep %setup -q -%patch0 -p1 -b non_x86_fix -%patch1 -p1 -b bug_fix_strlen -%patch2 -p1 -b fix_switch_fallthrough %build # Copy the whole directory to Python3 build @@ -394,6 +423,8 @@ fi %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/%{name}.pc +%{_mandir}/man3/lsm_* +%{_mandir}/man3/libstoragemgmt* %files -n python2-%{name} %defattr(-,root,root,-) @@ -462,8 +493,6 @@ fi %{python3_sitelib}/lsm/plugin/smispy/smis.* %{python3_sitelib}/lsm/plugin/smispy/dmtf.* %{python3_sitelib}/lsm/plugin/smispy/utils.* -%{python3_sitelib}/lsm/plugin/smispy/WBEM.* -%{python3_sitelib}/lsm/plugin/smispy/lmiwbem_wrap.* %{python3_sitelib}/lsm/plugin/smispy/smis_common.* %{python3_sitelib}/lsm/plugin/smispy/smis_cap.* %{python3_sitelib}/lsm/plugin/smispy/smis_sys.* @@ -534,7 +563,48 @@ fi %config(noreplace) %{_sysconfdir}/lsm/pluginconf.d/hpsa.conf %{_mandir}/man1/hpsa_lsmplugin.1* +%files nfs-plugin +%defattr(-,root,root,-) +%dir %{python3_sitelib}/lsm/plugin/nfs +%dir %{python3_sitelib}/lsm/plugin/nfs/__pycache__ +%{python3_sitelib}/lsm/plugin/nfs/__pycache__/* +%{python3_sitelib}/lsm/plugin/nfs/__init__.* +%{python3_sitelib}/lsm/plugin/nfs/nfs.* +%{python3_sitelib}/lsm/plugin/nfs/nfs_clib.* +%{_sysconfdir}/lsm/pluginconf.d/nfs.conf +%{_bindir}/nfs_lsmplugin +%{_mandir}/man1/nfs_lsmplugin.1* + +%files arcconf-plugin +%defattr(-,root,root,-) +%dir %{python3_sitelib}/lsm/plugin/arcconf +%dir %{python3_sitelib}/lsm/plugin/arcconf/__pycache__ +%{python3_sitelib}/lsm/plugin/arcconf/__pycache__/* +%{python3_sitelib}/lsm/plugin/arcconf/__init__.* +%{python3_sitelib}/lsm/plugin/arcconf/arcconf.* +%{python3_sitelib}/lsm/plugin/arcconf/utils.* +%{_bindir}/arcconf_lsmplugin +%config(noreplace) %{_sysconfdir}/lsm/pluginconf.d/arcconf.conf +%{_mandir}/man1/arcconf_lsmplugin.1* + +%files local-plugin +%defattr(-,root,root,-) +%dir %{python3_sitelib}/lsm/plugin/local +%dir %{python3_sitelib}/lsm/plugin/local/__pycache__ +%{python3_sitelib}/lsm/plugin/local/__pycache__/* +%{python3_sitelib}/lsm/plugin/local/__init__.* +%{python3_sitelib}/lsm/plugin/local/local.* +%{_sysconfdir}/lsm/pluginconf.d/local.conf +%{_bindir}/local_lsmplugin +%{_mandir}/man1/local_lsmplugin.1* + %changelog +* Tue Oct 10 2017 Gris Ge - 1.5.0-0 +- New upstream release 1.5.0: + * New sub-package libstoragemgmt-nfs-plugin, libstoragemgmt-arcconf-plugin, + and libstoragemgmt-local-plugin. + * C API manpages for libstoragemgmt-devel package. + * Tue Oct 3 2017 Tony Asleson - 1.4.0-5 - Remove m2crypto requirement diff --git a/sources b/sources index 297acb8..14e1f5c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libstoragemgmt-1.4.0.tar.gz) = be799145dd03439f77bc5f11a6d667e93645be4648722428037fb11b23149d351cc3239d7b895011d395f0e39c6a0d507d6925b3e6c21804658d35e30afce752 +SHA512 (libstoragemgmt-1.5.0.tar.gz) = fa82383b2dac583c4a6fa49c94b2b37e803e22878edb4081cf23141be7f49a45ead5e9d21e541b8dcefc3d4fa7603bc30a28109e7cedcc2c2681b9e099958f72