]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: call nvme_ctrl_set_discovery_ctrl()
authorHannes Reinecke <hare@suse.de>
Tue, 16 Nov 2021 13:57:05 +0000 (14:57 +0100)
committerHannes Reinecke <hare@suse.de>
Wed, 17 Nov 2021 17:38:04 +0000 (18:38 +0100)
When creating a discovery connection the user might be using the
unique discovery NQN, so we should be calling nvme_ctrl_set_discovery_ctrl()
to mark the connection as a discovery connection.

Signed-off-by: Hannes Reinecke <hare@suse.de>
fabrics.c

index e947ced53ebc358e54e5618f6a985404127afc80..570076dccbe477a1aa2f2f9ede7bb3ebb1391cfd 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -368,6 +368,7 @@ static int discover_from_conf_file(nvme_host_t h, const char *desc,
                                     traddr, host_traddr, host_iface, trsvcid);
                if (!c)
                        goto next;
+               nvme_ctrl_set_discovery_ctrl(c, true);
                errno = 0;
                ret = nvmf_add_ctrl(h, c, &cfg, false);
                if (!ret) {
@@ -519,6 +520,7 @@ int nvmf_discover(const char *desc, int argc, char **argv, bool connect)
                        ret = errno;
                        goto out_free;
                }
+               nvme_ctrl_set_discovery_ctrl(c, true);
                ret = nvmf_add_ctrl(h, c, &cfg, false);
                if (ret) {
                        nvme_msg(LOG_ERR,