![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package libstoragemgmt for openSUSE:Factory checked in at 2017-05-27 13:07:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstoragemgmt (Old) and /work/SRC/openSUSE:Factory/.libstoragemgmt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libstoragemgmt" Sat May 27 13:07:53 2017 rev:11 rq:495829 version:1.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libstoragemgmt/libstoragemgmt.changes 2017-04-28 10:53:19.134822014 +0200 +++ /work/SRC/openSUSE:Factory/.libstoragemgmt.new/libstoragemgmt.changes 2017-05-27 13:09:24.831435691 +0200 @@ -1,0 +2,12 @@ +Thu May 18 09:43:43 UTC 2017 - mliska@suse.cz + +- Add 0001-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch to + fix build with GCC 7. + +------------------------------------------------------------------- +Tue May 16 10:30:33 UTC 2017 - mpluskal@suse.com + +- Sync patches with fedora: + * 0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch + +------------------------------------------------------------------- New: ---- 0001-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch 0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstoragemgmt.spec ++++++ --- /var/tmp/diff_new_pack.25ie3Y/_old 2017-05-27 13:09:25.451348045 +0200 +++ /var/tmp/diff_new_pack.25ie3Y/_new 2017-05-27 13:09:25.451348045 +0200 @@ -28,6 +28,10 @@ Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz # PATCH-FIX-UPSTREAM 0001-Fix-gcc-warning-on-non-x86-platform.patch -- Fix build in ppc64le/s390x related to getopt_long Patch0: 0001-Fix-gcc-warning-on-non-x86-platform.patch +# PATCH-FIX-UPSTREAM 0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch +Patch1: 0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch +# PATCH-FIX-UPSTREAM 0001-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch +Patch2: 0001-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libconfig-devel @@ -194,7 +198,9 @@ %prep %setup -q -%patch0 -p1 +%patch0 +%patch1 +%patch2 -p1 %build %configure \ ++++++ 0001-Fix-gcc-warning-on-non-x86-platform.patch ++++++ --- /var/tmp/diff_new_pack.25ie3Y/_old 2017-05-27 13:09:25.471345217 +0200 +++ /var/tmp/diff_new_pack.25ie3Y/_new 2017-05-27 13:09:25.471345217 +0200 @@ -27,11 +27,11 @@ 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) +Index: tools/udev/scan-scsi-target.c +=================================================================== +--- tools/udev/scan-scsi-target.c.orig ++++ tools/udev/scan-scsi-target.c +@@ -54,7 +54,7 @@ static void __attribute__ ((__noreturn__ int main(int argc, char **argv) { ++++++ 0001-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch ++++++
From fa8e9e94c6d06ac135d4363293b00b1a42ebf5c4 Mon Sep 17 00:00:00 2001 From: Gris Ge <fge@redhat.com> 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 <fge@redhat.com> --- 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) -- 2.12.2 ++++++ 0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch ++++++ Index: c_binding/libses.c =================================================================== --- c_binding/libses.c.orig +++ c_binding/libses.c @@ -341,9 +341,9 @@ static int _ses_sg_paths_get(char *err_m (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);