Compare commits

..

No commits in common. "ceb5ea73d393b19ae1e6c7285a8209057da121e3" and "5215822e04eaddd67210c91cad544c6c7655ff5f" have entirely different histories.

6 changed files with 35 additions and 108 deletions

21
0000-signed-char.patch Normal file
View File

@ -0,0 +1,21 @@
commit ed5ff9b9505e50b545e86dfbdd32077f0ddda0cb
Author: Taylor Jakobson <tjakobs@us.ibm.com>
Date: Thu Feb 1 14:44:32 2018 -0600
Use signed char instead of char
Python3 does not have the "character" type, use signed char instead.
diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py
index 3a2db10..5af448f 100644
--- a/targetcli/ui_backstore.py
+++ b/targetcli/ui_backstore.py
@@ -536,7 +536,7 @@ class UIBlockBackstore(UIBackstore):
except (OSError, IOError):
raise ExecutionError("Could not open %s" % dev)
# ioctl returns an int. Provision a buffer for it
- buf = array.array('c', [chr(0)] * 4)
+ buf = array.array('b', [0] * 4)
try:
fcntl.ioctl(f, BLKROGET, buf)
except (OSError, IOError):

View File

@ -1,30 +0,0 @@
From 560993168d85ec7c84e9aacba5659aa17b40588c 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 | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py
index 2c46765..56f5419 100644
--- a/targetcli/ui_target.py
+++ b/targetcli/ui_target.py
@@ -1151,9 +1151,8 @@ 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 = 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()
--
2.27.0

View File

@ -1,43 +0,0 @@
From 4424eba4ba9f5c66c0cd8691fd4aad87ee19640f Mon Sep 17 00:00:00 2001
From: Maurizio Lombardi <mlombard@redhat.com>
Date: Thu, 19 Oct 2023 14:15:54 +0200
Subject: [PATCH] target: remove the reference to MAX_LUN
The MappedLUN.MAX_LUN symbol has been removed from rtslib.
Remove the reference to it.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
targetcli/ui_target.py | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py
index e8ba6c6..2c46765 100644
--- a/targetcli/ui_target.py
+++ b/targetcli/ui_target.py
@@ -1146,16 +1146,11 @@ class UILUNs(UINode):
mapped_lun = 0
existing_mluns = [mlun.mapped_lun for mlun in acl.mapped_luns]
if mapped_lun in existing_mluns:
- mapped_lun = None
- for possible_mlun in six.moves.range(MappedLUN.MAX_LUN):
- if possible_mlun not in existing_mluns:
- mapped_lun = possible_mlun
- break
-
- if mapped_lun == None:
- self.shell.log.warning(
- "Cannot map new lun %s into ACL %s"
- % (lun_object.lun, acl.node_wwn))
+ possible_mlun = 0
+ while possible_mlun in existing_mluns:
+ 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"
--
2.27.0

Binary file not shown.

View File

@ -1,15 +1,14 @@
Name: targetcli
Version: 2.1.fb48
Release: 9
License: ASL 2.0
Summary: Generic SCSI target CLI shell
Version: 2.1.56
Release: 3
URL: https://github.com/open-iscsi/targetcli-fb
Source: https://github.com/open-iscsi/targetcli-fb/archive/v%{version}/targetcli-fb-%{version}.tar.gz
Patch01: remove-reference-to-MAX_LUN.patch
Patch02: fix-mapping-the-new-LUN-to-the-node-ACL.patch
Source: https://github.com/open-iscsi/targetcli-fb/archive/v2.1.fb48.tar.gz
Patch0000: 0000-signed-char.patch
BuildArch: noarch
BuildRequires: python3-devel python3-setuptools systemd
Requires: python3-rtslib target-restore python3-configshell python3-six python3-dbus python3-gobject-base
BuildRequires: python3-devel python3-setuptools
Requires: python3-rtslib target-restore python3-configshell python3-six python3-dbus python3-gobject
%description
Targetcli is an administration tool for managing storage targets
@ -25,44 +24,24 @@ Help document for the %{name} package.
%autosetup -n targetcli-fb-%{version} -p1
%build
%py3_build
%{__python3} setup.py build
gzip --stdout targetcli.8 > targetcli.8.gz
%install
%py3_install
mkdir -p %{buildroot}%{_sysconfdir}/target/backup
mkdir -p %{buildroot}%{_mandir}/man8/
install -m 644 targetcli*.8 %{buildroot}%{_mandir}/man8/
mkdir -p %{buildroot}%{_unitdir}/
install -m 644 systemd/* %{buildroot}%{_unitdir}/
%{__python3} setup.py install --skip-build --root %{buildroot}
install -d %{buildroot}%{_sysconfdir}/target/backup
install -D -m 644 targetcli.8.gz %{buildroot}%{_mandir}/man8/targetcli.8.gz
%files
%doc README.md
%license COPYING
%{python3_sitelib}/targetcli*
%doc COPYING README.md
%{python3_sitelib}/*
%{_bindir}/targetcli
%{_bindir}/targetclid
%{_unitdir}/*
%dir %{_sysconfdir}/target
%dir %{_sysconfdir}/target/backup
%files help
%{_mandir}/man8/targetcli*.8*
%{_mandir}/man8/targetcli.8.gz
%changelog
* Mon May 13 2024 yanshuai <yanshuai@kylinos.cn> - 2.1.56-3
- fix mapping the new LUN to the node ACL
* Wed May 8 2024 yanshuai <yanshuai@kylinos.cn> - 2.1.56-2
- remove the reference to MAX_LUN
* Mon Jul 24 2023 zhangchenglin <zhangchenglin@kylinos.cn> - 2.1.56-1
- upgrade version to 2.1.56
* Wed Dec 29 2021 wulei <wulei80@huawei.com> - 2.1.54-1
- Package update
* Wed Jul 15 2020 wangyue <wangyue92@huawei.com> - 2.1.fb48-10
- fix unexpected error raised when adding luns
* Fri Feb 14 2020 lingsheng <lingsheng@huawei.com> - 2.1.fb48-9
- Package int

BIN
v2.1.fb48.tar.gz Normal file

Binary file not shown.