summaryrefslogtreecommitdiffstats
path: root/src/nvme/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvme/tree.c')
-rw-r--r--src/nvme/tree.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/nvme/tree.c b/src/nvme/tree.c
index b992824..18826bf 100644
--- a/src/nvme/tree.c
+++ b/src/nvme/tree.c
@@ -252,6 +252,19 @@ void nvme_host_set_dhchap_key(nvme_host_t h, const char *key)
h->dhchap_key = strdup(key);
}
+void nvme_host_set_pdc_enabled(nvme_host_t h, bool enabled)
+{
+ h->pdc_enabled_valid = true;
+ h->pdc_enabled = enabled;
+}
+
+bool nvme_host_is_pdc_enabled(nvme_host_t h, bool fallback)
+{
+ if (h->pdc_enabled_valid)
+ return h->pdc_enabled;
+ return fallback;
+}
+
nvme_subsystem_t nvme_first_subsystem(nvme_host_t h)
{
return list_top(&h->subsystems, struct nvme_subsystem, entry);
@@ -870,6 +883,16 @@ bool nvme_ctrl_is_discovery_ctrl(nvme_ctrl_t c)
return c->discovery_ctrl;
}
+void nvme_ctrl_set_unique_discovery_ctrl(nvme_ctrl_t c, bool unique)
+{
+ c->unique_discovery_ctrl = unique;
+}
+
+bool nvme_ctrl_is_unique_discovery_ctrl(nvme_ctrl_t c)
+{
+ return c->unique_discovery_ctrl;
+}
+
int nvme_ctrl_identify(nvme_ctrl_t c, struct nvme_id_ctrl *id)
{
return nvme_identify_ctrl(nvme_ctrl_get_fd(c), id);
@@ -931,7 +954,7 @@ int nvme_disconnect_ctrl(nvme_ctrl_t c)
c->name, errno);
return ret;
}
- nvme_msg(r, LOG_INFO, "%s: disconnected\n", c->name);
+ nvme_msg(r, LOG_INFO, "%s: %s disconnected\n", c->name, c->subsysnqn);
nvme_deconfigure_ctrl(c);
return 0;
}
@@ -1833,6 +1856,7 @@ static nvme_ns_t nvme_ns_open(const char *name)
close_fd:
close(n->fd);
free_ns:
+ free(n->generic_name);
free(n->name);
free(n);
return NULL;