summaryrefslogtreecommitdiffstats
path: root/hw/block/nvme.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/block/nvme.h')
-rw-r--r--hw/block/nvme.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/block/nvme.h b/hw/block/nvme.h
index 85a7b5a14f..1287bc2cd1 100644
--- a/hw/block/nvme.h
+++ b/hw/block/nvme.h
@@ -235,6 +235,11 @@ static inline void nvme_ns_attach(NvmeCtrl *n, NvmeNamespace *ns)
n->namespaces[nvme_nsid(ns) - 1] = ns;
}
+static inline void nvme_ns_detach(NvmeCtrl *n, NvmeNamespace *ns)
+{
+ n->namespaces[nvme_nsid(ns) - 1] = NULL;
+}
+
static inline NvmeCQueue *nvme_cq(NvmeRequest *req)
{
NvmeSQueue *sq = req->sq;