diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-06 07:51:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-06 07:51:39 +0000 |
commit | 593ffd6b9dc008e81ed95579a0f56c49bf3e782f (patch) | |
tree | b3a10caf7583dc08b7beed1a329f3b65a1dffe33 /staslib/conf.py | |
parent | Adding upstream version 2.3~rc2. (diff) | |
download | nvme-stas-593ffd6b9dc008e81ed95579a0f56c49bf3e782f.tar.xz nvme-stas-593ffd6b9dc008e81ed95579a0f56c49bf3e782f.zip |
Adding upstream version 2.3~rc3.upstream/2.3_rc3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'staslib/conf.py')
-rw-r--r-- | staslib/conf.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/staslib/conf.py b/staslib/conf.py index e5c038b..4497698 100644 --- a/staslib/conf.py +++ b/staslib/conf.py @@ -334,9 +334,10 @@ class SvcConf(metaclass=singleton.Singleton): # pylint: disable=too-many-public 'transport': [TRANSPORT], 'traddr': [TRADDR], 'trsvcid': [TRSVCID], + 'subsysnqn': [NQN], 'host-traddr': [TRADDR], 'host-iface': [IFACE], - 'subsysnqn': [NQN], + 'host-nqn': [NQN], 'dhchap-ctrl-secret': [KEY], 'hdr-digest': [BOOL] 'data-digest': [BOOL] @@ -721,9 +722,11 @@ class NbftConf(metaclass=singleton.Singleton): hfis = data.get('hfi', []) discovery = data.get('discovery', []) subsystem = data.get('subsystem', []) + host = data.get('host', {}) + hostnqn = host.get('nqn', None) if host.get('host_nqn_configured', False) else None - self._disc_ctrls.extend(NbftConf.__nbft_disc_to_cids(discovery, hfis)) - self._subs_ctrls.extend(NbftConf.__nbft_subs_to_cids(subsystem, hfis)) + self._disc_ctrls.extend(NbftConf.__nbft_disc_to_cids(hostnqn, discovery, hfis)) + self._subs_ctrls.extend(NbftConf.__nbft_subs_to_cids(hostnqn, subsystem, hfis)) dcs = property(lambda self: self._disc_ctrls) iocs = property(lambda self: self._subs_ctrls) @@ -738,12 +741,14 @@ class NbftConf(metaclass=singleton.Singleton): return self.dcs if defs.PROG_NAME == 'stafd' else [] @staticmethod - def __nbft_disc_to_cids(discovery, hfis): + def __nbft_disc_to_cids(hostnqn, discovery, hfis): cids = [] for ctrl in discovery: cid = NbftConf.__uri2cid(ctrl['uri']) cid['subsysnqn'] = ctrl['nqn'] + if hostnqn: + cid['host-nqn'] = hostnqn host_iface = NbftConf.__get_host_iface(ctrl.get('hfi_index'), hfis) if host_iface: @@ -754,7 +759,7 @@ class NbftConf(metaclass=singleton.Singleton): return cids @staticmethod - def __nbft_subs_to_cids(subsystem, hfis): + def __nbft_subs_to_cids(hostnqn, subsystem, hfis): cids = [] for ctrl in subsystem: @@ -766,6 +771,8 @@ class NbftConf(metaclass=singleton.Singleton): 'hdr-digest': ctrl['pdu_header_digest_required'], 'data-digest': ctrl['data_digest_required'], } + if hostnqn: + cid['host-nqn'] = hostnqn indexes = ctrl.get('hfi_indexes') if isinstance(indexes, list) and len(indexes) > 0: |