diff --git a/SOURCES/BZ_1872745.patch b/SOURCES/BZ_1872745.patch new file mode 100644 index 0000000..1528bac --- /dev/null +++ b/SOURCES/BZ_1872745.patch @@ -0,0 +1,61 @@ +diff --git a/plugin/hpsa/hpsa.py b/plugin/hpsa/hpsa.py +index c56cb21..ed5593d 100644 +--- a/plugin/hpsa/hpsa.py ++++ b/plugin/hpsa/hpsa.py +@@ -118,25 +118,40 @@ def _sanitize_output(output_lines, return_warning=False): + num_lines = len(output_lines) + sanitized = [] + i = 0 ++ ++ critical_msgs = ['Warning:'] ++ info_msgs = ['Encryption is enabled'] + while i < num_lines: + if output_lines[i]: +- # Newer versions report things like media errors +- if output_lines[i].startswith('Warning:'): +- start = i + 1 +- warning = output_lines[i] +- +- # Append all lines until next empty +- for z in range(start, num_lines): +- i += 1 +- if output_lines[z]: +- warning += ' ' + output_lines[z] +- else: +- break + +- if warning_msg is None: +- warning_msg = warning[9:] +- +- elif output_lines[i].startswith('Note:'): ++ # Newer versions report things like media errors ++ for critical_msg in critical_msgs: ++ if output_lines[i].startswith(critical_msg): ++ start = i + 1 ++ warning = output_lines[i] ++ ++ # Append all lines until next empty ++ for z in range(start, num_lines): ++ i += 1 ++ if output_lines[z]: ++ warning += ' ' + output_lines[z] ++ else: ++ break ++ ++ if warning_msg is None: ++ warning_msg = warning[9:] ++ ++ for info_msg in info_msgs: ++ # Discard the whole block ++ if output_lines[i].startswith(info_msg): ++ start = i ++ ++ for z in range(start, num_lines): ++ i += 1 ++ if not output_lines[z]: ++ break ++ ++ if output_lines[i].startswith('Note:'): + # Discard + pass + else: diff --git a/SOURCES/BZ_1903665.patch b/SOURCES/BZ_1903665.patch new file mode 100644 index 0000000..caef61c --- /dev/null +++ b/SOURCES/BZ_1903665.patch @@ -0,0 +1,31 @@ +diff --git a/c_binding/libsg.c b/c_binding/libsg.c +index 4689369..4adc3c9 100644 +--- a/c_binding/libsg.c ++++ b/c_binding/libsg.c +@@ -502,6 +502,11 @@ int _sg_io_vpd(char *err_msg, int fd, uint8_t page_code, uint8_t *data) + case _SG_T10_SBC_VPD_BLK_DEV_CHA: + data_len = _T10_SBC_VPD_BLK_DEV_CHA_MAX_LEN; + break; ++ case _SG_T10_SPC_VPD_SUP_VPD_PGS: ++ case _SG_T10_SPC_VPD_UNIT_SN: ++ case _SG_T10_SPC_VPD_DI: ++ data_len = _SG_T10_SPC_VPD_SMALL_MAX_LEN; ++ break; + default: + data_len = _SG_T10_SPC_VPD_MAX_LEN; + } +diff --git a/c_binding/libsg.h b/c_binding/libsg.h +index 3fb6ab5..467d27d 100644 +--- a/c_binding/libsg.h ++++ b/c_binding/libsg.h +@@ -63,7 +63,9 @@ + /* SPC-5 rev 7, Table 142 - INQUIRY command */ + #define _SG_T10_SPC_INQUIRY_MAX_LEN 0xffff + /* VPD is a INQUIRY */ +-#define _SG_T10_SPC_VPD_MAX_LEN _SG_T10_SPC_INQUIRY_MAX_LEN ++#define _SG_T10_SPC_VPD_MAX_LEN _SG_T10_SPC_INQUIRY_MAX_LEN ++/* some controller/drives don't like a two-byte length for VPD pages 0, 0x80, 0x83 */ ++#define _SG_T10_SPC_VPD_SMALL_MAX_LEN 0xfc + + /* SPC-5 Table 444 - PROTOCOL IDENTIFIER field values */ + #define _SG_T10_SPC_PROTOCOL_ID_OBSOLETE 1 diff --git a/SPECS/libstoragemgmt.spec b/SPECS/libstoragemgmt.spec index 27912a4..1d66896 100644 --- a/SPECS/libstoragemgmt.spec +++ b/SPECS/libstoragemgmt.spec @@ -4,12 +4,14 @@ Name: libstoragemgmt Version: 1.8.1 -Release: 1%{?dist} +Release: 2%{?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 +Patch1: BZ_1872745.patch +Patch2: BZ_1903665.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: %{name}-python @@ -520,6 +522,10 @@ fi %{_mandir}/man1/local_lsmplugin.1* %changelog +* Thu Feb 4 2021 Tony Asleson - 1.8.1-2 +- https://bugzilla.redhat.com/show_bug.cgi?id=1872745 +- https://bugzilla.redhat.com/show_bug.cgi?id=1903665 + * Tue Aug 13 2019 Tony Asleson - 1.8.1-1 - Upgrade to 1.8.1 - Obsolete the netapp plugin.