Hello community,
here is the log from the commit of package lsvpd for openSUSE:Factory checked in at 2017-12-19 10:58:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lsvpd (Old)
and /work/SRC/openSUSE:Factory/.lsvpd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lsvpd"
Tue Dec 19 10:58:19 2017 rev:48 rq:557961 version:1.7.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/lsvpd/lsvpd.changes 2017-09-26 21:17:28.252681937 +0200
+++ /work/SRC/openSUSE:Factory/.lsvpd.new/lsvpd.changes 2017-12-19 10:58:21.381730147 +0100
@@ -1,0 +2,12 @@
+Mon Dec 18 08:08:09 UTC 2017 - jloeser@suse.com
+
+- bug fixes (bsc#1072079)
+ - Add host number in device location code to distinguish
+ different devices
+ - Add workaround for std::ios_base::failure issue
+
+- added patches:
+ * lsvpd.bug-1072079_add_host_number.patch
+ * lsvpd.bug-1072079_std_io_base_failure_workaround.patch
+
+-------------------------------------------------------------------
New:
----
lsvpd.bug-1072079_add_host_number.patch
lsvpd.bug-1072079_std_io_base_failure_workaround.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ lsvpd.spec ++++++
--- /var/tmp/diff_new_pack.4P6vhE/_old 2017-12-19 10:58:22.057697516 +0100
+++ /var/tmp/diff_new_pack.4P6vhE/_new 2017-12-19 10:58:22.061697322 +0100
@@ -24,6 +24,8 @@
Group: System/Monitoring
Url: http://sourceforge.net/projects/linux-diag/
Source0: http://sourceforge.net/projects/linux-diag/files/lsvpd-new/%{version}/%{name}-%{version}.tar.gz
+Patch0: lsvpd.bug-1072079_add_host_number.patch
+Patch1: lsvpd.bug-1072079_std_io_base_failure_workaround.patch
BuildRequires: gcc-c++
BuildRequires: librtas-devel
BuildRequires: libvpd2-devel
@@ -45,6 +47,8 @@
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
%build
export CFLAGS="%{optflags} -UPCI_IDS -DPCI_IDS='\"%{_datadir}/pci.ids\"' -UUSB_IDS -DUSB_IDS='\"%{_datadir}/usb.ids\"'"
++++++ lsvpd.bug-1072079_add_host_number.patch ++++++
commit f5a8a079dff00e3d71631a9d8899bfa5c11028e1
Author: Ankit Kumar
Date: Wed Nov 15 15:40:02 2017 +0530
Add host number in device location code to distinguish different devices
This patch adds host number in location code as well to differentiate
two different devices if both has same bus, target and lun number.
H1-B0-T0-L0 [on]
H0-B0-T0-L0 [off]
Signed-off-by: Ankit Kumar
[Added host value check and removing hyphen so that location code start
with H<x> - Vasant]
Signed-off-by: Vasant Hegde
diff --git a/src/internal/sys_interface/devicetreecollector.cpp b/src/internal/sys_interface/devicetreecollector.cpp
index dc7ff54..6afbe85 100644
--- a/src/internal/sys_interface/devicetreecollector.cpp
+++ b/src/internal/sys_interface/devicetreecollector.cpp
@@ -765,7 +765,7 @@ ERROR:
{
Component *parent;
ostringstream val;
- const DataItem *target, *lun, *bus;
+ const DataItem *target, *lun, *bus, *host;
/* Build up a distinct YL based on parents YL - for device such as
* scsi, ide, usb, etc that do not generate ibm,loc-code
@@ -778,7 +778,9 @@ ERROR:
target = fillMe->getDeviceSpecific("XT");
lun = fillMe->getDeviceSpecific("XL");
bus = fillMe->getDeviceSpecific("XB");
- if (target != NULL && lun != NULL && bus != NULL) {
+ host = fillMe->getDeviceSpecific("XH");
+ if (host != NULL && target != NULL &&
+ lun != NULL && bus != NULL) {
if (fillMe->mPhysicalLocation.dataValue != "")
val << fillMe->mPhysicalLocation.dataValue;
else if
@@ -787,8 +789,8 @@ ERROR:
else
val << getAttrValue( parent->deviceTreeNode.dataValue,
"ibm,loc-code" );
- val << "-B" << bus->dataValue << "-T" << target->dataValue
- << "-L" << lun->dataValue;
+ val << "H" << host->dataValue << "-B" << bus->dataValue
+ << "-T" << target->dataValue << "-L" << lun->dataValue;
fillMe->mPhysicalLocation.setValue( val.str( ), 60 ,
__FILE__, __LINE__ );
}
++++++ lsvpd.bug-1072079_std_io_base_failure_workaround.patch ++++++
commit c36b20b7dc2e787f7285e459851df1a74368e8e3
Author: Vasant Hegde
Date: Wed Sep 20 16:52:35 2017 +0530
lsvpd: Add workaround for std::ios_base::failure' issue
Recently on P9 we started seeing below error.
#vpdupdate
terminate called after throwing an instance of 'std::ios_base::failure'
what(): basic_filebuf::underflow error reading the file
Aborted (core dumped)
It turns out that we needed c++ fix. Lets add workaround so that we
don't crash.
Signed-off-by: Vasant Hegde
Reviewed-by: Ankit Kumar
diff --git a/src/internal/sys_interface/icollector.cpp b/src/internal/sys_interface/icollector.cpp
index 0d48c93..d6407d9 100644
--- a/src/internal/sys_interface/icollector.cpp
+++ b/src/internal/sys_interface/icollector.cpp
@@ -104,6 +104,17 @@ namespace lsvpd
*/
string ICollector::getBinaryData( const string& path )
{
+ struct stat sbuf;
+
+ /*
+ * Check file existence and size before calling ifstream
+ *
+ * Workaround for libstdc++ issue.
+ * https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=250545
+ */
+ if ((stat(path.c_str(), &sbuf) != 0) || (sbuf.st_size == 0))
+ return "";
+
ifstream fi(path.c_str(), ios::binary);
string str;