Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
ceb5ea73d3
!25 Fix mapping the new LUN to the node ACL
From: @yanyan11222 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2024-05-20 09:27:08 +00:00
yanshuai01
cb6fd31a2a fix mapping the new LUN to the node ACL 2024-05-13 15:46:51 +08:00
openeuler-ci-bot
106115ec6b
!22 target: remove the reference to MAX_LUN
From: @yanyan11222 
Reviewed-by: @wk333 
Signed-off-by: @wk333
2024-05-08 09:30:03 +00:00
yanshuai01
8ebaf3da26 target: remove the reference to MAX_LUN 2024-05-08 15:58:42 +08:00
openeuler-ci-bot
e4104c058c
!15 Update package to version 2.1.56
From: @lingjuer 
Reviewed-by: @wang--ge, @caodongxia 
Signed-off-by: @caodongxia
2024-01-03 03:44:56 +00:00
lingjuer
83fa9b7fa9 Update to version 2.1.56 2023-07-24 10:25:18 +08:00
openeuler-ci-bot
7af0b5dba3
!8 [sync] PR-7: targetcli升级至2.1.54
From: @openeuler-sync-bot 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-04-14 06:18:03 +00:00
wu-leilei
8811fd8a0d package update
(cherry picked from commit 74dc5cf832b2dc830d00e80c7bca6e819ef723b0)
2022-04-12 14:35:56 +08:00
openeuler-ci-bot
d2d2a1edd8 !3 Fix unexpected error raised when adding luns
Merge pull request !3 from wang_yue111/master
2020-07-15 19:50:12 +08:00
wang_yue111
f4863df394 Fix unexpected error raised when adding luns 2020-07-15 19:26:52 +08:00
6 changed files with 108 additions and 35 deletions

View File

@ -1,21 +0,0 @@
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

@ -0,0 +1,30 @@
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

@ -0,0 +1,43 @@
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

BIN
targetcli-fb-2.1.56.tar.gz Normal file

Binary file not shown.

View File

@ -1,14 +1,15 @@
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/v2.1.fb48.tar.gz
Patch0000: 0000-signed-char.patch
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
BuildArch: noarch
BuildRequires: python3-devel python3-setuptools
Requires: python3-rtslib target-restore python3-configshell python3-six python3-dbus python3-gobject
BuildRequires: python3-devel python3-setuptools systemd
Requires: python3-rtslib target-restore python3-configshell python3-six python3-dbus python3-gobject-base
%description
Targetcli is an administration tool for managing storage targets
@ -24,24 +25,44 @@ Help document for the %{name} package.
%autosetup -n targetcli-fb-%{version} -p1
%build
%{__python3} setup.py build
gzip --stdout targetcli.8 > targetcli.8.gz
%py3_build
%install
%{__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
%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}/
%files
%doc COPYING README.md
%{python3_sitelib}/*
%doc README.md
%license COPYING
%{python3_sitelib}/targetcli*
%{_bindir}/targetcli
%{_bindir}/targetclid
%{_unitdir}/*
%dir %{_sysconfdir}/target
%dir %{_sysconfdir}/target/backup
%files help
%{_mandir}/man8/targetcli.8.gz
%{_mandir}/man8/targetcli*.8*
%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

Binary file not shown.