diff options
author | Klaus Jensen <k.jensen@samsung.com> | 2021-03-23 09:03:10 +0100 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2021-04-06 20:44:56 +0200 |
commit | 5ad7d0174e8e5f3e5af27719d4fc5f6a93efa1f2 (patch) | |
tree | f2e54a795ccde9029d5ba6a0c1543104721b0aba | |
parent | d0d3dd401b70168a353450e031727affee828527 (diff) | |
download | qemu-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>
-rw-r--r-- | hw/block/nvme-ns.c | 2 |
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; |