1
0
Fork 0

Merging upstream version 2.3~rc3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 12:54:59 +01:00
parent 55e7d80fc6
commit 892b155d7d
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
20 changed files with 189 additions and 75 deletions

View file

@ -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: