diff --git a/Auto-detect-readonly-state-for-iblock-devices.patch b/Auto-detect-readonly-state-for-iblock-devices.patch deleted file mode 100644 index cb06d49..0000000 --- a/Auto-detect-readonly-state-for-iblock-devices.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 5d1abab36be9375f46210dd19d5293cf73433681 Mon Sep 17 00:00:00 2001 -From: David Disseldorp -Date: Thu, 7 Dec 2017 15:25:35 +0100 -Subject: [PATCH 1/4] Auto-detect readonly state for iblock devices - -Configuring a read-only block device as read-write currently results in -a backstore->enable configfs I/O error, as documented in: -http://www.spinics.net/lists/target-devel/msg16310.html - -This change sees targetcli check the read-only status of the underlying -block device via ioctl(BLKROGET). If a readonly= parameter isn't -provided, then the backstore will use the ioctl(BLKROGET) value as the -default. - -Signed-off-by: David Disseldorp -(cherry picked from commit 1a0886ecbcba6d5b2d9756ecadb3e2eaab99d29e) ---- - targetcli/ui_backstore.py | 30 +++++++++++++++++++++++++++++- - 1 file changed, 29 insertions(+), 1 deletion(-) - -diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py -index 83673a0..66a21c5 100644 ---- a/targetcli/ui_backstore.py -+++ b/targetcli/ui_backstore.py -@@ -19,6 +19,9 @@ under the License. - - import glob - import os -+import fcntl -+import array -+import struct - import re - import stat - import dbus -@@ -516,6 +519,25 @@ class UIBlockBackstore(UIBackstore): - self.so_cls = UIBlockStorageObject - UIBackstore.__init__(self, 'block', parent) - -+ def _ui_block_ro_check(self, dev): -+ BLKROGET=0x0000125E -+ try: -+ f = os.open(dev, os.O_RDONLY) -+ 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) -+ try: -+ fcntl.ioctl(f, BLKROGET, buf) -+ except (OSError, IOError): -+ os.close(f) -+ return False -+ -+ os.close(f) -+ if struct.unpack('I', buf)[0] == 0: -+ return False -+ return True -+ - def ui_command_create(self, name, dev, readonly=None, wwn=None): - ''' - Creates an Block Storage object. I{dev} is the path to the TYPE_DISK -@@ -523,7 +545,13 @@ class UIBlockBackstore(UIBackstore): - ''' - self.assert_root() - -- readonly = self.ui_eval_param(readonly, 'bool', False) -+ ro_string = self.ui_eval_param(readonly, 'string', None) -+ if ro_string == None: -+ # attempt to detect block device readonly state via ioctl -+ readonly = self._ui_block_ro_check(dev) -+ else: -+ readonly = self.ui_eval_param(readonly, 'bool', False) -+ - wwn = self.ui_eval_param(wwn, 'string', None) - - so = BlockStorageObject(name, dev, readonly=readonly, wwn=wwn) --- -2.13.6 - diff --git a/Use-signed-char-instead-of-char.patch b/Use-signed-char-instead-of-char.patch deleted file mode 100644 index c8b04f1..0000000 --- a/Use-signed-char-instead-of-char.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 5bfd75f66225fb4127faa2dd14d3c43af9a575a4 Mon Sep 17 00:00:00 2001 -From: Taylor Jakobson -Date: Thu, 1 Feb 2018 14:44:32 -0600 -Subject: [PATCH 2/4] Use signed char instead of char - -Python3 does not have the "character" type, use signed char instead. - -(cherry picked from commit ed5ff9b9505e50b545e86dfbdd32077f0ddda0cb) -Reviewed-by: David Disseldorp ---- - targetcli/ui_backstore.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py -index 66a21c5..546d9d2 100644 ---- a/targetcli/ui_backstore.py -+++ b/targetcli/ui_backstore.py -@@ -526,7 +526,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): --- -2.13.6 - diff --git a/_service b/_service index be5878c..8826a61 100644 --- a/_service +++ b/_service @@ -7,7 +7,7 @@ @PARENT_TAG@ v(\d*\.\d*\.)fb(\d*) \1\2 - v2.1.fb47 + v2.1.fb49 enable diff --git a/_servicedata b/_servicedata index 4d65eb3..b341b7f 100644 --- a/_servicedata +++ b/_servicedata @@ -1,4 +1,4 @@ https://github.com/open-iscsi/targetcli-fb.git - ee32a2493eaccd9352cc596b9e3387960cca48fc \ No newline at end of file + 4d08771c0e6bf3cacba2ed3d3127dd10a86a7847 \ No newline at end of file diff --git a/rbd-support.patch b/rbd-support.patch index a21a9fa..df30bdc 100644 --- a/rbd-support.patch +++ b/rbd-support.patch @@ -9,14 +9,12 @@ https://marc.info/?l=ceph-devel&m=143816209010058 [ddiss@suse.de: accept and propagate wwn parameter] Reviewed-by: David Disseldorp --- - targetcli/ui_backstore.py | 59 +++++++++++++++++++++++++++++++++++++++++++++++ + targetcli/ui_backstore.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) -diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py -index 57dedb1..d576122 100644 --- a/targetcli/ui_backstore.py +++ b/targetcli/ui_backstore.py -@@ -29,6 +29,7 @@ import dbus +@@ -29,6 +29,7 @@ import stat from configshell_fb import ExecutionError from rtslib_fb import BlockStorageObject, FileIOStorageObject from rtslib_fb import PSCSIStorageObject, RDMCPStorageObject, UserBackedStorageObject @@ -24,7 +22,7 @@ index 57dedb1..d576122 100644 from rtslib_fb import ALUATargetPortGroup from rtslib_fb import RTSLibError from rtslib_fb import RTSRoot -@@ -269,6 +270,7 @@ class UIBackstores(UINode): +@@ -281,6 +282,7 @@ class UIBackstores(UINode): UIRDMCPBackstore(self) UIFileIOBackstore(self) UIBlockBackstore(self) @@ -32,7 +30,7 @@ index 57dedb1..d576122 100644 for name, iface, prop_dict in self._user_backstores(): UIUserBackedBackstore(self, name, iface, prop_dict) -@@ -572,6 +574,48 @@ class UIBlockBackstore(UIBackstore): +@@ -589,6 +591,48 @@ class UIBlockBackstore(UIBackstore): completions = [completions[0] + ' '] return completions @@ -81,7 +79,7 @@ index 57dedb1..d576122 100644 class UIUserBackedBackstore(UIBackstore): ''' -@@ -739,6 +783,21 @@ class UIBlockStorageObject(UIStorageObject): +@@ -791,6 +835,21 @@ class UIBlockStorageObject(UIStorageObje return ("%s (%s) %s%s %s" % (so.udev_path, bytes_to_human(so.size), ro_str, wb_str, so.status), True) @@ -103,6 +101,3 @@ index 57dedb1..d576122 100644 class UIUserBackedStorageObject(UIStorageObject): def summary(self): --- -2.13.6 - diff --git a/targetcli-fb-2.1.47.tar.xz b/targetcli-fb-2.1.47.tar.xz deleted file mode 100644 index cb9b86d..0000000 --- a/targetcli-fb-2.1.47.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5b7ec8b0984e5f058f237c5b8eaa4d80dbb817f22f5ae45bb9247e1c09f408b -size 29140 diff --git a/targetcli-fb-2.1.49.tar.xz b/targetcli-fb-2.1.49.tar.xz new file mode 100644 index 0000000..60e7a36 --- /dev/null +++ b/targetcli-fb-2.1.49.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad5a9438589cb63bbde70ecaf78614686b8b623480297f210bb323972d7acb66 +size 30080 diff --git a/targetcli-fb.changes b/targetcli-fb.changes index f08ef39..2aefb3a 100644 --- a/targetcli-fb.changes +++ b/targetcli-fb.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Thu Oct 18 19:50:11 UTC 2018 - opensuse-packaging@opensuse.org + +- Update to version 2.1.49: + * version 2.1.fb49 + * targetcli-fb: Add support for media change + * fix the parameter of define_config_group_param + * saveconfig: handle backups with block-level delete + * saveconfig: way for block-level save with delete command + * create: add a way to set control string + * fix amount of backup files in backup dir + * config: add saveconfig command to StorageObject level + * Allow to customize a home directory + * Fix default max_backup_files in ui_command_saveconfig + * MappedLuns and Luns max number is not the same anymore + * Use signed char instead of char + * version 2.1.fb48 + * remove wrong exit code from targetcli --version + * backup: global option to tune max no. of backup conf files + * config: rename key 'kept_backups' as 'max_backup_files' + * config: backup when current config is different from recent backup copy + * config: defend on '/etc/target/backup' directory + * Auto-detect readonly state for iblock devices + * Read number of backup files to keep from file + * skip refreshing user backed storage object when it is null + * Replace dbus-python with GObject Introspection + This replaces targetcli-fb-2.1.47.tar.xz with targetcli-fb-2.1.49.tar.xz, + and removes the following patches: + * Auto-detect-readonly-state-for-iblock-devices.patch + * Use-signed-char-instead-of-char.patch + * targetcli-only-save-old-config-if-present.patch + and updates the SPEC file. + ------------------------------------------------------------------- Fri Apr 20 19:13:39 UTC 2018 - lduncan@suse.com diff --git a/targetcli-fb.spec b/targetcli-fb.spec index 69d8c4a..f301549 100644 --- a/targetcli-fb.spec +++ b/targetcli-fb.spec @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: targetcli-fb -Version: 2.1.47 +Version: 2.1.49 Release: 0 Summary: A command shell for managing the Linux LIO kernel target License: Apache-2.0 @@ -54,11 +54,8 @@ Provides: targetcli-rbd = %{version} Obsoletes: targetcli-rbd < %{version} %endif %{?systemd_requires} -Patch1: Auto-detect-readonly-state-for-iblock-devices.patch -Patch2: Use-signed-char-instead-of-char.patch -Patch3: Split-out-blockdev-readonly-state-detection-helper.patch -Patch4: rbd-support.patch -Patch5: targetcli-only-save-old-config-if-present.patch +Patch1: Split-out-blockdev-readonly-state-detection-helper.patch +Patch2: rbd-support.patch %python_subpackages @@ -84,13 +81,10 @@ python2-targetcli-fb and python3-targetcli-fb. %prep %setup -q %patch1 -p1 -%patch2 -p1 -%patch3 -p1 %if 0%{?sle_version} == 150000 # RBD support is dependent on LIO changes present in the SLE/Leap kernel -%patch4 -p1 +%patch2 -p1 %endif -%patch5 -p1 %build %python_build diff --git a/targetcli-only-save-old-config-if-present.patch b/targetcli-only-save-old-config-if-present.patch deleted file mode 100644 index 83b9180..0000000 --- a/targetcli-only-save-old-config-if-present.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Lee Duncan -Date: Fri Apr 20 12:07:30 PDT 2018 -Subject: [PATCH] targetcli: only save old config if present - -There is no reason to copy the current configuration to the -backup directory if there is no current configuration. - -Already fixed upstream, but the code is totally different -there. - -Signed-off-by: Lee Duncan ---- ---- a/targetcli/ui_root.py 2018-04-20 11:53:58.987907240 -0700 -+++ b/targetcli/ui_root.py 2018-04-20 11:56:35.231375345 -0700 -@@ -70,7 +70,7 @@ class UIRoot(UINode): - savefile = os.path.expanduser(savefile) - - # Only save backups if saving to default location -- if savefile == default_save_file: -+ if (savefile == default_save_file) and os.path.exists(savefile): - backup_dir = os.path.dirname(savefile) + "/backup" - backup_name = "saveconfig-" + \ - datetime.now().strftime("%Y%m%d-%H:%M:%S") + ".json"