Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

6 changed files with 112 additions and 107 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/targetcli-fb-2.1.53.tar.gz SOURCES/targetcli-fb-2.1.57.tar.gz

View File

@ -1 +1 @@
cb06b7dc70606e63974df107d418c2344dcc7d7b SOURCES/targetcli-fb-2.1.53.tar.gz a1e13273f92bfeeef28b4491c6dc8d786a44c44c SOURCES/targetcli-fb-2.1.57.tar.gz

View File

@ -0,0 +1,31 @@
From 02831aca57444862b9546d2d8a02e59d6ec4aaf1 Mon Sep 17 00:00:00 2001
From: Maurizio Lombardi <mlombard@redhat.com>
Date: Tue, 30 Jan 2024 13:03:08 +0100
Subject: [PATCH] Fix mapping the new LUN to the node ACL
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
targetcli/ui_target.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py
index 2c46765f9d1a..65df61f96185 100644
--- a/targetcli/ui_target.py
+++ b/targetcli/ui_target.py
@@ -1151,10 +1151,9 @@ class UILUNs(UINode):
possible_mlun += 1
mapped_lun = possible_mlun
- else:
- mlun = MappedLUN(acl, mapped_lun, lun_object, write_protect=False)
- self.shell.log.info("Created LUN %d->%d mapping in node ACL %s"
- % (mlun.tpg_lun.lun, mlun.mapped_lun, acl.node_wwn))
+ mlun = MappedLUN(acl, mapped_lun, lun_object, write_protect=False)
+ self.shell.log.info("Created LUN %d->%d mapping in node ACL %s"
+ % (mlun.tpg_lun.lun, mlun.mapped_lun, acl.node_wwn))
self.parent.refresh()
return self.new_node(ui_lun)
--
2.39.3

View File

@ -1,13 +0,0 @@
diff --git a/setup.py b/setup.py
index 4518165..2ebfc04 100755
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@ setup(
'scripts/targetcli',
'daemon/targetclid'
],
- data_files = [('/lib/systemd/system', ['systemd/targetclid.socket', 'systemd/targetclid.service'])],
+ data_files = [('/usr/lib/systemd/system', ['systemd/targetclid.socket', 'systemd/targetclid.service'])],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",

View File

@ -1,55 +0,0 @@
From 3176671662bda79d4b4059b8cc22b4b31a6547e0 Mon Sep 17 00:00:00 2001
From: Maurizio Lombardi <mlombard@redhat.com>
Date: Fri, 13 Nov 2020 11:44:40 +0100
Subject: [PATCH] fileio backstore: fix sparse file creation
fallocate() can't be used to create sparse files because it
actually preallocates all the disk space that will be used by the file
backstore, sparse files do not have preallocated disk space
by definition.
We must therefore use ftruncate().
We can, on the other hand, use fallocate() to create non-sparse
files and fall back to the slower "while() fwrite()" if we
are running on Python version < 3.3 where fallocate() is not available
Fixes 3bd4d8ef7c9b154c53e8b8dd863a570bce7f5c2c
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
targetcli/ui_backstore.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py
index 8692f22..9bc0c58 100644
--- a/targetcli/ui_backstore.py
+++ b/targetcli/ui_backstore.py
@@ -423,17 +423,17 @@ class UIFileIOBackstore(UIBackstore):
raise ExecutionError("Could not open %s" % filename)
try:
if sparse:
+ os.ftruncate(f.fileno(), size)
+ else:
+ self.shell.log.info("Writing %d bytes" % size)
try:
+ # Prior to version 3.3, Python does not provide fallocate
os.posix_fallocate(f.fileno(), 0, size)
except AttributeError:
- # Prior to version 3.3, Python does not provide fallocate
- os.ftruncate(f.fileno(), size)
- else:
- self.shell.log.info("Writing %d bytes" % size)
- while size > 0:
- write_size = min(size, 1024)
- f.write("\0" * write_size)
- size -= write_size
+ while size > 0:
+ write_size = min(size, 1024)
+ f.write("\0" * write_size)
+ size -= write_size
except (OSError, IOError):
os.remove(filename)
raise ExecutionError("Could not expand file to %d bytes" % size)
--
2.28.0

View File

@ -2,18 +2,18 @@
Name: targetcli Name: targetcli
License: ASL 2.0 License: ASL 2.0
Group: System Environment/Libraries
Summary: An administration shell for storage targets Summary: An administration shell for storage targets
Version: 2.1.53 Version: 2.1.57
Release: 2%{?dist} Release: 2%{?dist}
URL: https://github.com/open-iscsi/%{oname} URL: https://github.com/open-iscsi/%{oname}
Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz
Patch0: 0001-setup.py-add-the-socket-and-service-files-to-the-dat.patch # Proposed upstream
Patch1: 0002-fileio-backstore-fix-sparse-file-creation.patch ## From: https://github.com/open-iscsi/targetcli-fb/pull/176
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel, python3-setuptools BuildRequires: python3-devel, python3-setuptools, systemd-rpm-macros
Requires: python3-rtslib, target-restore, python3-configshell, python3-six, python3-dbus, python3-gobject-base Requires: python3-rtslib, target-restore, python3-configshell, python3-six, python3-dbus
Requires: python3-gobject-base
Patch0: 0001-Fix-mapping-the-new-LUN-to-the-node-ACL.patch
%description %description
An administration shell for configuring iSCSI, FCoE, and other An administration shell for configuring iSCSI, FCoE, and other
@ -24,56 +24,98 @@ users will also need to install and use fcoe-utils.
%prep %prep
%setup -q -n %{oname}-%{version} %setup -q -n %{oname}-%{version}
%patch0 -p1 %patch0 -p1
%patch1 -p1
%build %build
%{__python3} setup.py build %py3_build
gzip --stdout targetcli.8 > targetcli.8.gz
gzip --stdout targetclid.8 > targetclid.8.gz
%install %install
mkdir -p %{buildroot}%{_unitdir} %py3_install
%{__python3} setup.py install --skip-build --root %{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/target/backup mkdir -p %{buildroot}%{_sysconfdir}/target/backup
mkdir -p %{buildroot}%{_sysconfdir}/target/pr
mkdir -p %{buildroot}%{_mandir}/man8/ mkdir -p %{buildroot}%{_mandir}/man8/
install -m 644 targetcli.8.gz %{buildroot}%{_mandir}/man8/ install -m 644 targetcli*.8 %{buildroot}%{_mandir}/man8/
install -m 644 targetclid.8.gz %{buildroot}%{_mandir}/man8/ mkdir -p %{buildroot}%{_unitdir}/
install -m 644 systemd/* %{buildroot}%{_unitdir}/
%files %files
%{python3_sitelib}/* %doc README.md
%license COPYING
%{python3_sitelib}/targetcli*
%{_bindir}/targetcli %{_bindir}/targetcli
%{_bindir}/targetclid %{_bindir}/targetclid
%{_mandir}/man8/targetcli*.8*
%{_unitdir}/*
%dir %{_sysconfdir}/target %dir %{_sysconfdir}/target
%dir %{_sysconfdir}/target/backup %dir %{_sysconfdir}/target/backup
%dir %{_sysconfdir}/target/pr
%doc COPYING README.md
%{_mandir}/man8/targetcli.8.gz
%{_mandir}/man8/targetclid.8.gz
%{_usr}/lib/systemd/system/targetclid.service
%{_usr}/lib/systemd/system/targetclid.socket
%changelog %changelog
* Tue Dec 01 2020 Maurizio Lombardi <mlombard@redhat.com> - 2.1.53-2 * Tue Jan 30 2024 Maurizio Lombardi <mlombard@redhat.com> - 2.1.57-2
- Fix sparse file creation - Fix a regression in LUN creation and ACL mapping Jira: RHEL-23294
* Thu Jun 25 2020 Maurizio Lombardi <mlombard@redhat.com> - 2.1.53-1 * Mon Oct 30 2023 Maurizio Lombardi <mlombard@redhat.com> - 2.1.57-1
- Update to new upstream version - Update to the latest version
* Mon May 11 2020 Maurizio Lombardi <mlombard@redhat.com> - 2.1.52-1 * Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.1.53-7
- Update to new upstream version - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Dec 06 2019 Maurizio Lombardi <mlombard@redhat.com> - 2.1.51-2 * Thu Jun 24 2021 Maurizio Lombardi <mlombard@redhat.com> - 2.1.53-5
- Create the target/pr directory when installing the package - Add the gating.yaml file
* Mon Nov 18 2019 Maurizio Lombardi <mlombard@redhat.com> - 2.1.51-1 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.1.53-4
- Update to new upstream release - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Sep 06 2018 Maurizio Lombardi <mlombard@redhat.com> - 2.1.fb49-1 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.53-3
- Update to new upstream release - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Aug 06 2018 Maurizio Lombardi <mlombard@redhat.com> - 2.1.fb48-4 * Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.53-2
- Fix code incompatible with python3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jun 25 2020 Matt Coleman <matt@datto.com> - 2.1.53-1
- New upstream version
- Add the upstream project's targetclid systemd unit files
- Add proposed upstream patch:
+ Do not install systemd files in setup.py
+ https://github.com/open-iscsi/targetcli-fb/pull/176
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb49-9
- Rebuilt for Python 3.9
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb49-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Nov 01 2019 Neal Gompa <ngompa13@gmail.com> - 2.1.fb49-7
- Use correct Python macros to build the package
- Fix file list and install COPYING as license file
- Don't compress manpages in build phase, as rpm auto-compresses manpages
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb49-6
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb49-5
- Rebuilt for Python 3.8
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb49-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Mar 15 2019 Alan Pevec <apevec AT redhat.com> - 2.1.fb49-3
- Reduce dep to python3-gobject-base rhbz#1688808
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb49-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Oct 10 2018 Andy Grover <agrover@redhat.com> - 2.1.fb49-1
- New upstream version
- Fix URL so spectool -g works
- Remove patch 0001-signed-char.patch
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb48-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb48-5
- Rebuilt for Python 3.7
* Tue May 8 2018 Andy Grover <agrover@redhat.com> - 2.1.fb48-4
- Add patch 0001-signed-char.patch
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.1.fb48-3 * Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.1.fb48-3
- Escape macros in %%changelog - Escape macros in %%changelog