diff --git a/libnvme/src/nvme/fabrics.c b/libnvme/src/nvme/fabrics.c index 6917e66141..3ca0f22518 100644 --- a/libnvme/src/nvme/fabrics.c +++ b/libnvme/src/nvme/fabrics.c @@ -1193,8 +1193,12 @@ static int nvmf_connect_disc_entry(nvme_host_t h, c->cfg.disable_sqflow = true; if (e->trtype == NVMF_TRTYPE_TCP && - e->tsas.tcp.sectype != NVMF_TCP_SECTYPE_NONE) - c->cfg.tls = true; + e->tsas.tcp.sectype != NVMF_TCP_SECTYPE_NONE) { + if (e->treq & NVMF_TREQ_REQUIRED) + c->cfg.tls = true; + else if (e->treq & NVMF_TREQ_NOT_REQUIRED) + c->cfg.concat = true; + } ret = nvmf_add_ctrl(h, c, cfg); if (!ret) { @@ -2313,6 +2317,12 @@ static int nvmf_create_discovery_ctrl(struct nvme_global_ctx *ctx, return -ENOMEM; } + ret = nvme_open(ctx, c->name, &c->hdl); + if (ret) { + nvme_msg(ctx, LOG_ERR, "failed to open %s\n", c->name); + return ret; + } + /* Find out the name of discovery controller */ ret = nvme_ctrl_identify(c, id); if (ret) {