Merge ~sergiodj/ubuntu/+source/python-rtslib-fb:fix-cpu-allowed-list-s390x into ubuntu/+source/python-rtslib-fb:ubuntu/devel

Proposed by Sergio Durigan Junior
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: cf8a04fceb473180ecdec62831563df82c57d070
Proposed branch: ~sergiodj/ubuntu/+source/python-rtslib-fb:fix-cpu-allowed-list-s390x
Merge into: ubuntu/+source/python-rtslib-fb:ubuntu/devel
Diff against target: 113 lines (+91/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/handle-target-kernel-module-new-attribute-cpus_allow.patch (+82/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Lucas Kanashiro (community) Approve
Canonical Server Reporter Pending
Review via email: mp+429265@code.launchpad.net

Description of the change

This MP fixes the dep8 test failure that is currently affecting targetcli-fb.

The problem is caused by the fact that the target Linux kernel module has a new "cpus_allowed_list" attribute which is not properly handled by python-rtslib-fb, as can be seen in the following log:

https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic/kinetic/s390x/t/targetcli-fb/20220830_075622_04113@/log.gz

Upstream has a fix for this:

https://github.com/open-iscsi/rtslib-fb/commit/8d2543c4da62e962661011fea5b19252b9660822

Ideally we would update the package to the latest version, but it's too late in the cycle for that. For this reason, I'm backporting the upstream patch.

PPA with the proposed change:

https://launchpad.net/~sergiodj/+archive/ubuntu/targetcli-fb/+packages

autopkgtest is now good:

http://autopkgtest.ubuntu.com/results/autopkgtest-kinetic-sergiodj-targetcli-fb/?format=plain

To post a comment you must log in.
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

I am reviewing this MP.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for this Sergio, all the changes look good to me. Package is building fine and autopkgtest is fixed in s390x. +1.

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: sergiodj, lucaskanashiro
Uploaders: sergiodj, lucaskanashiro
MP auto-approved

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Friday, September 02 2022, Lucas Kanashiro wrote:

> Thanks for this Sergio, all the changes look good to me. Package is building fine and autopkgtest is fixed in s390x. +1.

Thanks, Lucas. Uploaded:

$ dput python-rtslib-fb_2.1.74-0ubuntu5_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/python-rtslib-fb/python-rtslib-fb_2.1.74-0ubuntu5_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/python-rtslib-fb/python-rtslib-fb_2.1.74-0ubuntu5.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading python-rtslib-fb_2.1.74-0ubuntu5.dsc: done.
  Uploading python-rtslib-fb_2.1.74-0ubuntu5.debian.tar.xz: done.
  Uploading python-rtslib-fb_2.1.74-0ubuntu5_source.buildinfo: done.
  Uploading python-rtslib-fb_2.1.74-0ubuntu5_source.changes: done.
Successfully uploaded packages.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 903ce49..dc142ec 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+python-rtslib-fb (2.1.74-0ubuntu5) kinetic; urgency=medium
7+
8+ * d/p/handle-target-kernel-module-new-attribute-cpus_allow.patch:
9+ Handle new Linux kernel module attribute "cpus_allowed_list".
10+ (LP: #1988366)
11+
12+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Wed, 31 Aug 2022 22:41:11 -0400
13+
14 python-rtslib-fb (2.1.74-0ubuntu4) jammy; urgency=medium
15
16 * No-change rebuild to update maintainer scripts, see LP: 1959054
17diff --git a/debian/patches/handle-target-kernel-module-new-attribute-cpus_allow.patch b/debian/patches/handle-target-kernel-module-new-attribute-cpus_allow.patch
18new file mode 100644
19index 0000000..2853e46
20--- /dev/null
21+++ b/debian/patches/handle-target-kernel-module-new-attribute-cpus_allow.patch
22@@ -0,0 +1,82 @@
23+From: Mingzhe Zou <zoumingzhe@qq.com>
24+Date: Fri, 11 Feb 2022 15:49:23 +0800
25+Subject: handle target kernel module new attribute cpus_allowed_list
26+
27+target has been added cpus_allowed_list attribute in sysfs.
28+Therefore, the rtslib should handle the new attribute:
29+ 1. add cpus_allowed_list item in target_names_excludes
30+ 2. add cpus_allowed_list feature in ISCSIFabricModule
31+
32+Signed-off-by: Zou Mingzhe mingzhe.zou@easystack.cn
33+
34+Origin: upstream, https://github.com/open-iscsi/rtslib-fb/commit/8d2543c4da62e962661011fea5b19252b9660822
35+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-rtslib-fb/+bug/1988366
36+Applied-Upstream: 2.1.75
37+---
38+ rtslib/fabric.py | 32 ++++++++++++++++++++++++++++----
39+ 1 file changed, 28 insertions(+), 4 deletions(-)
40+
41+diff --git a/rtslib/fabric.py b/rtslib/fabric.py
42+index cb23a0f..aacbce7 100644
43+--- a/rtslib/fabric.py
44++++ b/rtslib/fabric.py
45+@@ -118,9 +118,15 @@ from .utils import RTSLibError, modprobe, ignored
46+ from .target import Target
47+ from .utils import _get_auth_attr, _set_auth_attr
48+
49+-version_attributes = set(["lio_version", "version"])
50+-discovery_auth_attributes = set(["discovery_auth"])
51+-target_names_excludes = version_attributes | discovery_auth_attributes
52++excludes_list = [
53++ # version_attributes
54++ "lio_version", "version",
55++ # discovery_auth_attributes
56++ "discovery_auth",
57++ # cpus_allowed_list_attributes
58++ "cpus_allowed_list",
59++]
60++target_names_excludes = set(excludes_list)
61+
62+
63+ class _BaseFabricModule(CFSNode):
64+@@ -144,7 +150,8 @@ class _BaseFabricModule(CFSNode):
65+ self.name = name
66+ self.spec_file = "N/A"
67+ self._path = "%s/%s" % (self.configfs_dir, self.name)
68+- self.features = ('discovery_auth', 'acls', 'auth', 'nps', 'tpgts')
69++ self.features = ('discovery_auth', 'acls', 'auth', 'nps', 'tpgts',
70++ 'cpus_allowed_list')
71+ self.wwn_types = ('free',)
72+ self.kernel_module = "%s_target_mod" % self.name
73+
74+@@ -220,6 +227,18 @@ class _BaseFabricModule(CFSNode):
75+ raise RTSLibError("Fabric module %s does not implement "
76+ + "the %s feature" % (self.name, feature))
77+
78++ def _get_cpus_allowed_list(self):
79++ self._check_self()
80++ self._assert_feature('cpus_allowed_list')
81++ path = "%s/cpus_allowed_list" % self.path
82++ return fread(path)
83++
84++ def _set_cpus_allowed_list(self, allowed):
85++ self._check_self()
86++ self._assert_feature('cpus_allowed_list')
87++ path = "%s/cpus_allowed_list" % self.path
88++ fwrite(path, allowed)
89++
90+ def clear_discovery_auth_settings(self):
91+ self._check_self()
92+ self._assert_feature('discovery_auth')
93+@@ -267,6 +286,11 @@ class _BaseFabricModule(CFSNode):
94+ self._assert_feature('discovery_auth')
95+ _set_auth_attr(self, *args, **kwargs)
96+
97++ cpus_allowed_list = \
98++ property(_get_cpus_allowed_list,
99++ _set_cpus_allowed_list,
100++ doc="Set or get the cpus_allowed_list attribute.")
101++
102+ discovery_enable_auth = \
103+ property(_get_discovery_enable_auth,
104+ _set_discovery_enable_auth,
105diff --git a/debian/patches/series b/debian/patches/series
106index 39b9b57..2877d7a 100644
107--- a/debian/patches/series
108+++ b/debian/patches/series
109@@ -1,3 +1,4 @@
110 fix-path-of-etc-saveconfig.json.patch
111 fix-interpreter-version.patch
112 lp1891214-disable-xen-pvscsi.patch
113+handle-target-kernel-module-new-attribute-cpus_allow.patch

Subscribers

People subscribed via source and target branches