summaryrefslogtreecommitdiffstats
path: root/hw/block/nvme-ns.c
diff options
context:
space:
mode:
authorMinwoo Im2021-02-12 13:11:39 +0100
committerKlaus Jensen2021-03-18 12:41:43 +0100
commitdc04d25e2f3f7e26f7f97b860992076b5f04afdb (patch)
tree27067390d00c1e37f03805485bbf7e55bb9f3369 /hw/block/nvme-ns.c
parenthw/block/nvme: pull lba format initialization (diff)
downloadqemu-dc04d25e2f3f7e26f7f97b860992076b5f04afdb.tar.gz
qemu-dc04d25e2f3f7e26f7f97b860992076b5f04afdb.tar.xz
qemu-dc04d25e2f3f7e26f7f97b860992076b5f04afdb.zip
hw/block/nvme: add support for the format nvm command
Format NVM admin command can make a namespace or namespaces to be with different LBA size and metadata size with protection information types. This patch introduces Format NVM command with LBA format, Metadata, and Protection Information for the device. The secure erase operation things and support for formatting zoned namespaces are yet to be added. The parameter checks inside of this patch has been referred from Keith's old branch. Signed-off-by: Minwoo Im <minwoo.im@samsung.com> [anaidu.gollu: rebased on e2e] Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com> [k.jensen: rebased for reworked aio tracking] Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'hw/block/nvme-ns.c')
-rw-r--r--hw/block/nvme-ns.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
index 1e8ef36ba5..7f8d139a86 100644
--- a/hw/block/nvme-ns.c
+++ b/hw/block/nvme-ns.c
@@ -32,7 +32,7 @@
#define MIN_DISCARD_GRANULARITY (4 * KiB)
-static void nvme_ns_init_format(NvmeNamespace *ns)
+void nvme_ns_init_format(NvmeNamespace *ns)
{
NvmeIdNs *id_ns = &ns->id_ns;
BlockDriverInfo bdi;
@@ -66,6 +66,7 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp)
int i;
ns->csi = NVME_CSI_NVM;
+ ns->status = 0x0;
ns->id_ns.dlfeat = 0x1;