]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
fabrics: fix fc config JSON file handling
authorMartin George <marting@netapp.com>
Tue, 4 Apr 2023 09:29:09 +0000 (14:59 +0530)
committerDaniel Wagner <wagi@monom.org>
Wed, 5 Apr 2023 10:17:52 +0000 (12:17 +0200)
commit3ea32db40c6c3ca278c09b5c8623268fafbb8052
tree6973f6c0d11fbcad4c5a4676e016ce88fa95cd7f
parente417662000247ff84c4b10e6d233381b5d0f7853
fabrics: fix fc config JSON file handling

Unlike other nvme transports, nvme/fc connection requires a valid
host_traddr in addition to traddr and transport type. Current fc
config JSON handling is broken due to the host_traddr not getting
updated even if explicitly listed in the JSON file, as shown below:

nvme connect-all -J /usr/local/etc/nvme/config.json
Failed to write to /dev/nvme-fabrics: Invalid argument

And the below error is logged in the messages file for the same:

nvme_fabrics: missing parameter 'host_traddr=%s'

Fix this by ensuring the relevant host_traddr string is appropriately
passed to the respective nvme controller structure. And while we are
at it, ensure the host_iface string is updated too but noting that it
is only applicable to tcp alone, and not rdma or fc.

Signed-off-by: Martin George <marting@netapp.com>
fabrics.c