[PATCH libnvme] fabrics: don't treat host_traddr 'none' as a valid hostname

Sagi Grimberg sagi at grimberg.me
Mon Jun 27 01:06:39 PDT 2022


We treat 'none' as an escape value for optional arguments, do the same
for host_traddr.

This makes prints like the below go away when passing --host-traddr=none:
sh[3244]: failed to resolve host none info

Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 src/nvme/tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/nvme/tree.c b/src/nvme/tree.c
index d87b25961237..916179180294 100644
--- a/src/nvme/tree.c
+++ b/src/nvme/tree.c
@@ -960,6 +960,8 @@ static bool traddr_is_hostname(const char *transport, const char *traddr)
 
 	if (!traddr || !transport)
 		return false;
+	if (!strcmp(traddr, "none"))
+		return false;
 	if (strcmp(transport, "tcp") &&
 	    strcmp(transport, "rdma"))
 		return false;
-- 
2.34.1




More information about the Linux-nvme mailing list