From 3bbd99c56d00908f66771d9940e5464a3add291f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 6 Apr 2025 10:19:19 +0200 Subject: [PATCH] Adding upstream version 2.4.1. Signed-off-by: Daniel Baumann --- NEWS.md | 6 ++++++ meson.build | 2 +- staslib/ctrl.py | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 01c6eb4..bafbe80 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # STorage Appliance Services (STAS) +## Changes with release 2.4.1 + +Bug fix: + +* Restore backward compatibility with libnvme 1.11 and earlier. The controller attribute `discovery_ctrl` was added in libnvme 1.12. Prior to this version, the method `discovery_ctrl_set()` is to be used. + ## Changes with release 2.4 New features: diff --git a/meson.build b/meson.build index 59f5929..f0be1eb 100644 --- a/meson.build +++ b/meson.build @@ -9,7 +9,7 @@ project( 'nvme-stas', meson_version: '>= 0.53.0', - version: '2.4', + version: '2.4.1', license: 'Apache-2.0', default_options: [ 'buildtype=release', diff --git a/staslib/ctrl.py b/staslib/ctrl.py index e18414e..9607228 100644 --- a/staslib/ctrl.py +++ b/staslib/ctrl.py @@ -221,7 +221,12 @@ class Controller(stas.ControllerABC): # pylint: disable=too-many-instance-attri host_traddr=self.tid.host_traddr if self.tid.host_traddr else None, host_iface=host_iface, ) - self._ctrl.discovery_ctrl = self._discovery_ctrl + try: + self._ctrl.discovery_ctrl = self._discovery_ctrl + except AttributeError: + # Note: discovery_ctrl_set() is deprecated. We keep it + # for backward compatibility with libnvme 1.11 and earlier. + self._ctrl.discovery_ctrl_set(self._discovery_ctrl) # Set the DHCHAP host key on the controller # NOTE that this may eventually have to