summaryrefslogtreecommitdiffstats
path: root/hw/block/nvme-ns.c
diff options
context:
space:
mode:
authorNiklas Cassel2020-12-08 21:04:03 +0100
committerKlaus Jensen2021-02-08 20:58:34 +0100
commit141354d55ba92768ea8fad54d441d3ba90d2b59e (patch)
tree111037ea589ec772df564e6c32f3a50503602c02 /hw/block/nvme-ns.c
parenthw/block/nvme: Add Commands Supported and Effects log (diff)
downloadqemu-141354d55ba92768ea8fad54d441d3ba90d2b59e.tar.gz
qemu-141354d55ba92768ea8fad54d441d3ba90d2b59e.tar.xz
qemu-141354d55ba92768ea8fad54d441d3ba90d2b59e.zip
hw/block/nvme: Add support for Namespace Types
Define the structures and constants required to implement Namespace Types support. Namespace Types introduce a new command set, "I/O Command Sets", that allows the host to retrieve the command sets associated with a namespace. Introduce support for the command set and enable detection for the NVM Command Set. The new workflows for identify commands rely heavily on zero-filled identify structs. E.g., certain CNS commands are defined to return a zero-filled identify struct when an inactive namespace NSID is supplied. Add a helper function in order to avoid code duplication when reporting zero-filled identify structures. Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw/block/nvme-ns.c')
-rw-r--r--hw/block/nvme-ns.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
index f6d752b714..f5f6284a4d 100644
--- a/hw/block/nvme-ns.c
+++ b/hw/block/nvme-ns.c
@@ -43,6 +43,8 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp)
id_ns->nsze = cpu_to_le64(nvme_ns_nlbas(ns));
+ ns->csi = NVME_CSI_NVM;
+
/* no thin provisioning */
id_ns->ncap = id_ns->nsze;
id_ns->nuse = id_ns->ncap;