commit 92671745b5b78213d4d7d549d65e748adad587de520c3b6e557d9b7f09b0c663 Author: Ismail Dönmez Date: Thu Mar 30 08:14:07 2017 +0000 Accepting request 483470 from openSUSE:Factory:zSystems Per Factory First policy, package for SLES12 SP3. Please also make me maintainer of the package in hardware project. Thanks. OBS-URL: https://build.opensuse.org/request/show/483470 OBS-URL: https://build.opensuse.org/package/show/hardware/qclib?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/qclib-1.2.0.tgz b/qclib-1.2.0.tgz new file mode 100644 index 0000000..99b7536 --- /dev/null +++ b/qclib-1.2.0.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7899b6558749d0d32e69a1d9c957cb2ed2845e18fcc14c9f1f4a64957c617f6 +size 72740 diff --git a/qclib-rpmlintrc b/qclib-rpmlintrc new file mode 100644 index 0000000..b279db6 --- /dev/null +++ b/qclib-rpmlintrc @@ -0,0 +1,6 @@ +addFilter("qclib.* no-binary") +addFilter("libqclib1.* shlib-policy-missing-lib") +addFilter("file-contains-date-and-time /usr/share/doc/packages/qclib/*") +addFilter("files-duplicate /usr/share/doc/packages/qclib/html/ftv2*") +addFilter("files-duplicate /usr/share/doc/packages/qclib/html/search/all_[12].js") +addFilter("files-duplicate /usr/share/doc/packages/qclib/html/search/classes_[04].js") diff --git a/qclib.changes b/qclib.changes new file mode 100644 index 0000000..b5541e3 --- /dev/null +++ b/qclib.changes @@ -0,0 +1,67 @@ +------------------------------------------------------------------- +Mon Mar 27 16:58:14 UTC 2017 - mpost@suse.com + +- Added qclib.correctly.interpret.sthyi.check.patch (bsc#1028105). + +------------------------------------------------------------------- +Mon Jun 13 19:56:59 UTC 2016 - mpost@suse.com + +- Upgraded to qclib 1.2 (bsc#984143) + - Removed source [S] for attributes qc_num_cpu_dedicated and + qc_num_cpu_shared in LPAR layer for consistency + - Retrieve qc_layer_name in CEC layer from OCF + - Extended hypfs usage to provide more CP, IFL and CPU counts for + CEC and LPAR layers, as well as capping information for LPAR + group and LPAR layers + - Added attributes for IFLs, CPs and CPUs for KVM hypervisor and + guest layers + - Added support for LPAR Groups + - Added new attribute qc_prorated_core_time + - Fill qc_num_cp_total and qc_num_ifl_total in LPAR layer from STHYI + - Consistency checks: Detect inconsistent values across data sources + - Documentation improvements + + Bug fixes: + - Fixed crash when setting QC_USE_DUMP to an invalid directory and + QC_DEBUG=1 + - Fixed reset of debug level when QC_CHECK_CONSISTENCY is invalid + - Display all values in attribute qc_partition_char in case of multiple + - Set qc_cp_dispatch_type in presence of CPs only + +------------------------------------------------------------------- +Tue Feb 16 15:00:13 UTC 2016 - mpost@suse.com + +- Upgraded to qclib 1.1.0 (fate#320435) +- Removed the following patches against version 1.0.0 + qclib.makefile.patch + qclib.disable.consistency.checks.patch + qclib.handle.hostnames.with.less.than.8.characters.in.presence.of.hypfs.patch +- Added a couple of comment lines to the header in the spec file. + +------------------------------------------------------------------- +Fri Jan 15 18:44:56 UTC 2016 - mpost@suse.com + +- Added qclib.disable.consistency.checks.patch (bsc#961643). +- Added qclib.handle.hostnames.with.less.than.8.characters.in.presence.of.hypfs.patch + (bsc#957607). + +------------------------------------------------------------------- +Fri Oct 30 20:47:53 UTC 2015 - mpost@suse.com + +- Replaced qclib.makefile.patch with IBM's version of the patch. + (bsc#951518). +- Modified the spec file to make use of the new "make install" + and "make installdoc" targets. +- Modified the spec file to account for slightly different file + locations. +- Added qclib.makefile.libdir.patch to enable building on both + s390x and s390 systems. +- Added two new filters to the qclib-devel-rpmlintrc file to + mask two new duplicate files that arrived with IBM's patched + Makefile. + +------------------------------------------------------------------- +Tue Oct 13 19:48:20 UTC 2015 - mpost@suse.com + +- Initial version + diff --git a/qclib.correctly.interpret.sthyi.check.patch b/qclib.correctly.interpret.sthyi.check.patch new file mode 100644 index 0000000..8b2b2c7 --- /dev/null +++ b/qclib.correctly.interpret.sthyi.check.patch @@ -0,0 +1,56 @@ +diff -Naurp qclib-1.2.0-vanilla/query_capacity.c qclib-1.2.0/query_capacity.c +--- qclib-1.2.0-vanilla/query_capacity.c 2016-06-03 09:14:01.000000000 +0200 ++++ qclib-1.2.0/query_capacity.c 2017-03-21 08:53:50.000000000 +0100 +@@ -96,7 +96,7 @@ static int qc_debug_file_init(void) { + close(fd); + goto out_err; + } +- qc_debug(NULL, "This is qclib v1.2.0, level a7ecaf7, date 2016-06-03 09:04:14 +0200\n"); ++ qc_debug(NULL, "This is qclib v1.2.0, level e5679bb, date 2017-03-21 08:49:07 +0100\n"); + } + + return 0; +diff -Naurp qclib-1.2.0-vanilla/query_capacity_sthyi.c qclib-1.2.0/query_capacity_sthyi.c +--- qclib-1.2.0-vanilla/query_capacity_sthyi.c 2016-06-03 09:14:01.000000000 +0200 ++++ qclib-1.2.0/query_capacity_sthyi.c 2017-03-21 08:53:50.000000000 +0100 +@@ -65,10 +65,10 @@ static int qc_is_sthyi_available(void) { + #endif + } + +-static int qc_sthyi(char *sthyi_buffer) { ++static int qc_sthyi(struct sthyi_priv *priv) { + #if defined __s390x__ || __s390__ + register unsigned long function_code asm("2") = 0; +- register unsigned long buffer asm("4") = (unsigned long) sthyi_buffer; ++ register unsigned long buffer asm("4") = (unsigned long) priv->data; + register unsigned long return_code asm("5"); + int cc = -1; + +@@ -80,10 +80,11 @@ static int qc_sthyi(char *sthyi_buffer) + : "memory", "cc"); + if (cc == 0) { + /* buffer was updated */ ++ priv->avail = STHYI_AVAILABLE; + return 1; + } +- /* if cc==-1: exception. never mind, return 0 */ +- /* if cc==3: never mind, r carries return code */ ++ if (cc == 3 && return_code == 4) ++ return 1; + #endif + + return 0; +@@ -496,12 +497,11 @@ static int qc_sthyi_open(struct qc_handl + } + qc_debug(hdl, "STHYI is available\n"); + /* we assume we are not relocated at this spot, between STFLE and STHYI */ +- if (!qc_sthyi(priv->data)) { ++ if (!qc_sthyi(priv)) { + qc_debug(hdl, "Error: STHYI execution failed\n"); + rc = -3; + goto out; + } +- priv->avail = STHYI_AVAILABLE; + } + goto out; + diff --git a/qclib.makefile.libdir.patch b/qclib.makefile.libdir.patch new file mode 100644 index 0000000..34a1d77 --- /dev/null +++ b/qclib.makefile.libdir.patch @@ -0,0 +1,17 @@ +--- qclib-1.0.0/Makefile 2015-10-26 07:46:09.000000000 +0100 ++++ qclib-1.0.0/Makefile 2015-10-26 07:50:21.000000000 +0100 +@@ -61,10 +61,10 @@ + + install: libqc.a libqc.so.$(VERSION) + echo " INSTALL" +- install -Dm 644 libqc.a $(DESTDIR)/usr/lib64/libqc.a +- install -Dm 755 libqc.so.$(VERSION) $(DESTDIR)/usr/lib64/libqc.so.$(VERSION) +- ln -sr $(DESTDIR)/usr/lib64/libqc.so.$(VERSION) $(DESTDIR)/usr/lib64/libqc.so.$(VERM) +- ln -sr $(DESTDIR)/usr/lib64/libqc.so.$(VERSION) $(DESTDIR)/usr/lib64/libqc.so ++ install -Dm 644 libqc.a $(DESTDIR)/usr/$(LIBDIR)/libqc.a ++ install -Dm 755 libqc.so.$(VERSION) $(DESTDIR)/usr/$(LIBDIR)/libqc.so.$(VERSION) ++ ln -sr $(DESTDIR)/usr/$(LIBDIR)/libqc.so.$(VERSION) $(DESTDIR)/usr/$(LIBDIR)/libqc.so.$(VERM) ++ ln -sr $(DESTDIR)/usr/$(LIBDIR)/libqc.so.$(VERSION) $(DESTDIR)/usr/$(LIBDIR)/libqc.so + install -Dm 644 query_capacity.h $(DESTDIR)/usr/include/query_capacity.h + install -Dm 644 README $(DESTDIR)/usr/share/doc/packages/qclib/README + install -Dm 644 LICENSE $(DESTDIR)/usr/share/doc/packages/qclib/LICENSE diff --git a/qclib.spec b/qclib.spec new file mode 100644 index 0000000..cafbe4e --- /dev/null +++ b/qclib.spec @@ -0,0 +1,128 @@ +# +# spec file for package qclib +# +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugzilla.suse.com/ + +Name: qclib +Version: 1.2.0 +Release: 0 +Url: http://www.ibm.com/developerworks/linux/linux390/qclib.html +Summary: Query Capacity library +License: BSD-3-Clause +Group: Development/System +BuildRequires: gcc-c++ +BuildRequires: doxygen +%if 0%{?suse_version} > 1300 +BuildRequires: glibc-devel-static +%else +BuildRequires: glibc-devel +%endif + +Source: %{name}-%{version}.tgz +Patch1: qclib.makefile.libdir.patch +Patch2: qclib.correctly.interpret.sthyi.check.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-build +ExclusiveArch: s390 s390x + +%description +qclib provides a C API for extraction of system information for Linux on z +Systems. + +For instance, it will provide the number of CPUs + * on the machine (CEC, Central Electronic Complex) layer + * on the PR/SM (Processor Resource/Systems Manager) layer, i.e. visible to + LPARs + * in z/VM hosts, guests and CPU pools + * in KVM hosts and guests +This allows calculating the upper limit of CPU resources a highest level guest +can use. + +E.g.: If an LPAR on a z13 provides 4 CPUs to a z/VM hypervisor, and the +hypervisor provides 8 virtual CPUs to a guest, qclib can be used to retrieve +all of these numbers, and it can be concluded that not more capacity than 4 +CPUs can be used by the software running in the guest. + +qclib uses various interfaces and provides this data through a common and +consistent API (Application Programming Interface), using information provided +by: + * STSI (Store System Information) instruction - for more details, refer to + the z/Architecture Principles of Operation (SA22-7832) + * STHYI (Store Hypervisor Information) instruction as provided by a z/VM + hypervisor - for more information, refer to z/VM: V6R3 CP Programming + Service (SC24-6179), chapter 'Store Hypervisor Information (STHYI) + Instruction'. + * hypfs file system - for more information, refer to 'Device Drivers, + Features, and Commands', chapter 'S/390 hypervisor file system'. + +%package -n libqclib1 +Summary: Query Capacity Library shared library +%description -n libqclib1 +qclib provides a C API for extraction of system information for Linux on z +Systems. + +%package devel +Summary: Development files for Query Capacity library +Requires: libqclib1 = %{version}-%{release} +%description devel +qclib provides a C API for extraction of system information for Linux on z +Systems. + +%prep +%setup -q -n %{name}-%{version} +%patch1 -p1 +%patch2 -p1 + +%build +MYCFLAGS=$(grep ^CFLAGS Makefile | cut -f2 -d=) +make all CFLAGS="${MYCFLAGS} ${RPM_OPT_FLAGS}" +make doc + +%check +make test +make test-sh + +%install +%ifarch s390x +LIBDIR=lib64 +%else +LIBDIR=lib +%endif + +%make_install LIBDIR=${LIBDIR} V=1 +make installdoc DESTDIR=${RPM_BUILD_ROOT} V=1 + +%post -n libqclib1 +ldconfig + +%postun -n libqclib1 +ldconfig + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(-,root,root) +%dir %{_docdir}/%{name} +%{_docdir}/%{name}/* + +%files -n libqclib1 +%{_libdir}/libqc.so.* + +%files devel +%{_includedir}/*.h +%{_libdir}/libqc.a +%{_libdir}/libqc.so + +%changelog