aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorKlaus Jensen <k.jensen@samsung.com>2021-03-23 09:03:10 +0100
committerKlaus Jensen <k.jensen@samsung.com>2021-04-06 20:44:56 +0200
commit5ad7d0174e8e5f3e5af27719d4fc5f6a93efa1f2 (patch)
treef2e54a795ccde9029d5ba6a0c1543104721b0aba /hw/block
parentd0d3dd401b70168a353450e031727affee828527 (diff)
downloadqemu-5ad7d0174e8e5f3e5af27719d4fc5f6a93efa1f2.zip
qemu-5ad7d0174e8e5f3e5af27719d4fc5f6a93efa1f2.tar.gz
qemu-5ad7d0174e8e5f3e5af27719d4fc5f6a93efa1f2.tar.bz2
hw/block/nvme: fix pi constraint check
Protection Information can only be enabled if there is at least 8 bytes of metadata. Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Gollu Appalanaidu <anaidu.gollu@samsung.com> Reviewed-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/nvme-ns.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
index 7f8d139..ca04ee1 100644
--- a/hw/block/nvme-ns.c
+++ b/hw/block/nvme-ns.c
@@ -394,7 +394,7 @@ static int nvme_ns_check_constraints(NvmeNamespace *ns, Error **errp)
return -1;
}
- if (ns->params.pi && !ns->params.ms) {
+ if (ns->params.pi && ns->params.ms < 8) {
error_setg(errp, "at least 8 bytes of metadata required to enable "
"protection information");
return -1;