#5 Update to new upstream version 1.4.1
Merged 2 months ago by mlombard. Opened 2 months ago by mlombard.
rpms/ mlombard/tcmu-runner f30  into  f30

file modified
+2

@@ -8,3 +8,5 @@ 

  /tcmu-runner-1.1.0.tar.gz

  /tcmu-runner-1.1.1.tar.gz

  /tcmu-runner-1.1.3.tar.gz

+ /tcmu-runner-1.4.0.tar.gz

+ /tcmu-runner-1.4.1.tar.gz

@@ -0,0 +1,68 @@ 

+ From 37704b589e9074b9727104c525c4dc6a0b6228fe Mon Sep 17 00:00:00 2001

+ From: Xiubo Li <xiubli@redhat.com>

+ Date: Mon, 11 Feb 2019 18:05:45 +0800

+ Subject: [PATCH 1/2] glfs: add gfapi version check

+ 

+ Signed-off-by: Xiubo Li <xiubli@redhat.com>

+ ---

+  CMakeLists.txt | 5 +++++

+  glfs.c         | 8 ++++++++

+  version.h.in   | 2 ++

+  3 files changed, 15 insertions(+)

+ 

+ diff --git a/CMakeLists.txt b/CMakeLists.txt

+ index 64af0f3..bc8d2f2 100644

+ --- a/CMakeLists.txt

+ +++ b/CMakeLists.txt

+ @@ -224,6 +224,11 @@ endif (with-rbd)

+  if (with-glfs)

+  	find_library(GFAPI gfapi)

+  

+ +	pkg_check_modules(GFAPI760 glusterfs-api>=7.6)

+ +	if (GFAPI760_FOUND)

+ +		set(GFAPI_VERSION 760)

+ +	endif (GFAPI760_FOUND)

+ +

+  	# Stuff for building the glfs handler

+  	add_library(handler_glfs

+  	  SHARED

+ diff --git a/glfs.c b/glfs.c

+ index 85f0f4b..610133f 100644

+ --- a/glfs.c

+ +++ b/glfs.c

+ @@ -26,6 +26,7 @@

+  #include "libtcmu.h"

+  #include "tcmur_device.h"

+  #include "tcmur_cmd_handler.h"

+ +#include "version.h"

+  

+  #define ALLOWED_BSOFLAGS (O_DIRECT | O_RDWR | O_LARGEFILE)

+  

+ @@ -566,7 +567,14 @@ static void tcmu_glfs_close(struct tcmu_device *dev)

+  	free(gfsp);

+  }

+  

+ +#if GFAPI_VERSION < 760

+  static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret, void *data)

+ +#else

+ +static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret,

+ +			   struct glfs_stat *prestat,

+ +			   struct glfs_stat *poststat,

+ +			   void *data)

+ +#endif

+  {

+  	glfs_cbk_cookie *cookie = data;

+  	struct tcmu_device *dev = cookie->dev;

+ diff --git a/version.h.in b/version.h.in

+ index 96d8893..516a366 100644

+ --- a/version.h.in

+ +++ b/version.h.in

+ @@ -2,3 +2,5 @@

+  #define TCMUR_VERSION "@VERSION@"

+  

+  #define DEFAULT_HANDLER_PATH "@tcmu-runner_HANDLER_PATH@"

+ +

+ +#define GFAPI_VERSION @GFAPI_VERSION@

+ -- 

+ 2.14.3

+ 

@@ -0,0 +1,70 @@ 

+ From 9bb76bd1117983d23f89d8ef93440f4ec98389a5 Mon Sep 17 00:00:00 2001

+ From: Xiubo Li <xiubli@redhat.com>

+ Date: Thu, 21 Mar 2019 09:33:28 +0800

+ Subject: [PATCH 2/2] glfs: fix build error for GFAPI version check

+ 

+ If the GFAPI version < 7.6, we will hit:

+ 

+ glfs.c:570:19: error: operator '<' has no left operand

+ ^

+ 

+ Signed-off-by: Xiubo Li <xiubli@redhat.com>

+ Reviewed-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>

+ ---

+  CMakeLists.txt | 6 ++++--

+  glfs.c         | 6 +++---

+  version.h.in   | 2 +-

+  3 files changed, 8 insertions(+), 6 deletions(-)

+ 

+ diff --git a/CMakeLists.txt b/CMakeLists.txt

+ index bc8d2f2..21a4fe7 100644

+ --- a/CMakeLists.txt

+ +++ b/CMakeLists.txt

+ @@ -224,9 +224,11 @@ endif (with-rbd)

+  if (with-glfs)

+  	find_library(GFAPI gfapi)

+  

+ -	pkg_check_modules(GFAPI760 glusterfs-api>=7.6)

+ +    set(GFAPI_VERSION760 0)

+ +

+ +    pkg_check_modules(GFAPI760 glusterfs-api>=7.6 QUIET)

+  	if (GFAPI760_FOUND)

+ -		set(GFAPI_VERSION 760)

+ +		set(GFAPI_VERSION760 1)

+  	endif (GFAPI760_FOUND)

+  

+  	# Stuff for building the glfs handler

+ diff --git a/glfs.c b/glfs.c

+ index 610133f..40326fd 100644

+ --- a/glfs.c

+ +++ b/glfs.c

+ @@ -567,13 +567,13 @@ static void tcmu_glfs_close(struct tcmu_device *dev)

+  	free(gfsp);

+  }

+  

+ -#if GFAPI_VERSION < 760

+ -static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret, void *data)

+ -#else

+ +#if GFAPI_VERSION760

+  static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret,

+  			   struct glfs_stat *prestat,

+  			   struct glfs_stat *poststat,

+  			   void *data)

+ +#else

+ +static void glfs_async_cbk(glfs_fd_t *fd, ssize_t ret, void *data)

+  #endif

+  {

+  	glfs_cbk_cookie *cookie = data;

+ diff --git a/version.h.in b/version.h.in

+ index 516a366..dd88a37 100644

+ --- a/version.h.in

+ +++ b/version.h.in

+ @@ -3,4 +3,4 @@

+  

+  #define DEFAULT_HANDLER_PATH "@tcmu-runner_HANDLER_PATH@"

+  

+ -#define GFAPI_VERSION @GFAPI_VERSION@

+ +#define GFAPI_VERSION760 @GFAPI_VERSION760@

+ -- 

+ 2.14.3

+ 

file modified
+1 -1

@@ -1,1 +1,1 @@ 

- f44745745b865b28792f98ab0832e67a  tcmu-runner-1.1.3.tar.gz

+ SHA512 (tcmu-runner-1.4.1.tar.gz) = 88dd0144877cc367a7d0dbf77a86c62ff32e23f11acb359df62204420cb228bf57d74b7175544d915cd918bcdfa04065acbeb5c31883f89ced76f599436aa605

file modified
+61 -28

@@ -1,14 +1,18 @@ 

  Name:           tcmu-runner

  License:        ASL 2.0

  Summary:        A daemon that supports LIO userspace backends

- Version:        1.1.3

- Release:        7%{?dist}

- URL:            https://github.com/agrover/tcmu-runner

- Source:         https://fedorahosted.org/released/tcmu-runner/%{name}-%{version}.tar.gz

- BuildRequires:  gcc

- BuildRequires:  cmake glib2-devel libnl3-devel glusterfs-api-devel kmod-devel zlib-devel

+ Version:        1.4.1

+ Release:        1%{?dist}

+ URL:            https://github.com/open-iscsi/tcmu-runner

+ Source:         %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

+ Patch0:         0001-glfs-add-gfapi-version-check.patch

+ Patch1:         0002-glfs-fix-build-error-for-GFAPI-version-check.patch

+ BuildRequires:  gcc make librados2-devel

+ BuildRequires:  cmake glib2-devel libnl3-devel glusterfs-api-devel kmod-devel zlib-devel librbd-devel

  Requires:       targetcli

  

+ ExcludeArch:    i686 armv7hl

+ 

  %description

  A daemon that handles the complexity of the LIO kernel target's userspace

  passthrough interface (TCMU). It presents a C plugin API for extension modules

@@ -31,42 +35,71 @@ 

  

  %prep

  %setup -q

+ %patch0 -p1

+ %patch1 -p1

  

  %build

- %cmake -DSUPPORT_SYSTEMD=ON .

+ %cmake -DSUPPORT_SYSTEMD=ON -DCMAKE_INSTALL_PREFIX=%{_usr} .

  make %{?_smp_mflags}

  gzip --stdout tcmu-runner.8 > tcmu-runner.8.gz

  

  %install

- make install DESTDIR=%{buildroot}

- mkdir -p %{buildroot}%{_mandir}/man8/

- install -m 644 tcmu-runner.8.gz %{buildroot}%{_mandir}/man8/

+ %{__make} DESTDIR=%{buildroot} install

+ %{__mkdir} -p %{buildroot}/etc/tcmu/

+ %{__install} -m 644 tcmu.conf %{buildroot}/etc/tcmu/

+ %{__mkdir} -p %{buildroot}%{_sysconfdir}/logrotate.d/

+ %{__install} -m 644 logrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/tcmu-runner

+ 

+ #make install DESTDIR=%{buildroot}

+ #mkdir -p %{buildroot}%{_mandir}/man8/

+ #install -m 644 tcmu-runner.8.gz %{buildroot}%{_mandir}/man8/

  

- %ldconfig_scriptlets -n libtcmu

+ #%ldconfig_scriptlets -n libtcmu

  

  %files

+ %defattr(-,root,root)

  %{_bindir}/tcmu-runner

- %dir %{_libdir}/tcmu-runner

- %{_libdir}/tcmu-runner/*

- %{_sysconfdir}/dbus-1/system.d/tcmu-runner.conf

- %{_datarootdir}/dbus-1/system-services/org.kernel.TCMUService1.service

+ %dir %{_sysconfdir}/dbus-1/

+ %dir %{_sysconfdir}/dbus-1/system.d

+ %config %{_sysconfdir}/dbus-1/system.d/tcmu-runner.conf

+ %dir %{_datadir}/dbus-1/

+ %dir %{_datadir}/dbus-1/system-services/

+ %{_datadir}/dbus-1/system-services/org.kernel.TCMUService1.service

  %{_unitdir}/tcmu-runner.service

- %doc README.md

- %license LICENSE

- %{_mandir}/man8/tcmu-runner.8.gz

- 

- 

- %files -n libtcmu

- %{_libdir}/*.so.*

- 

- %files -n libtcmu-devel

- %{_includedir}/libtcmu.h

- %{_includedir}/libtcmu_common.h

- %{_includedir}/tcmu-runner.h

- %{_libdir}/*.so

+ %dir %{_usr}/lib64/tcmu-runner/

+ %{_usr}/lib64/tcmu-runner/*

+ %{_mandir}/man8/*

+ %doc README.md LICENSE.LGPLv2.1 LICENSE.Apache2

+ %{_usr}/lib64/*

+ %dir %{_sysconfdir}/tcmu/

+ %config %{_sysconfdir}/tcmu/tcmu.conf

+ %config(noreplace) %{_sysconfdir}/logrotate.d/tcmu-runner

+ 

+ #%{_bindir}/tcmu-runner

+ #%dir %{_libdir}/tcmu-runner

+ #%{_libdir}/tcmu-runner/*

+ #%{_sysconfdir}/dbus-1/system.d/tcmu-runner.conf

+ #%{_datarootdir}/dbus-1/system-services/org.kernel.TCMUService1.service

+ #%{_unitdir}/tcmu-runner.service

+ #%doc README.md

+ #%license LICENSE.LGPLv2.1

+ #%{_mandir}/man8/tcmu-runner.8.gz

+ 

+ 

+ #%files -n libtcmu

+ #%{_libdir}/*.so.*

+ 

+ #%files -n libtcmu-devel

+ #%{_includedir}/libtcmu.h

+ #%{_includedir}/libtcmu_common.h

+ #%{_includedir}/tcmu-runner.h

+ #%{_libdir}/*.so

  

  

  %changelog

+ * Wed May 29 2019 Maurizio Lombardi <mlombard@redhat.com> - 1.4.1-1

+ - New upstream version

+ 

  * Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-7

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

  

  • Removed support to 32 bit archs

Signed-off-by: Maurizio Lombardi mlombard@redhat.com

Env Details:
[root@server-1 ~]# uname -a
Linux server-1 5.1.8-300.fc30.x86_64 #1 SMP Sun Jun 9 17:09:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@server-1 ~]# cat /etc/redhat-release
Fedora release 30 (Thirty)
[root@server-1 ~]# rpm -qa | grep tcmu-runner
tcmu-runner-1.4.1-1.fc30.x86_64
[root@server-1 ~]# rpm -qa | grep glusterfs-api
glusterfs-api-6.2-1.fc30.x86_64

Build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=35642602

I have tested tcmu-runner using its glfs handler, test scenarios include:
1. install package
2. create block volume (HA 3)
3. delete block volume
4. Modify Size for existing volume
5. Login and Mounting the volume on a multipath enabled initiator and Performing IO

All works well for me.

Thanks!

Pull-Request has been merged by mlombard

2 months ago