[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/11] hw/nvme: do not report null uuid
From: |
Klaus Jensen |
Subject: |
[PULL 08/11] hw/nvme: do not report null uuid |
Date: |
Fri, 3 Jun 2022 21:53:51 +0200 |
From: Klaus Jensen <k.jensen@samsung.com>
Do not report the "null uuid" (all zeros) in the namespace
identification descriptors.
Reported-by: Luis Chamberlain <mcgrof@kernel.org>
Reported-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ctrl.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index a2f6069f7fe1..909e357a7eb9 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -4955,16 +4955,13 @@ static uint16_t nvme_identify_ns_descr_list(NvmeCtrl
*n, NvmeRequest *req)
return NVME_INVALID_FIELD | NVME_DNR;
}
- /*
- * If the EUI-64 field is 0 and the NGUID field is 0, the namespace must
- * provide a valid Namespace UUID in the Namespace Identification
Descriptor
- * data structure. QEMU does not yet support setting NGUID.
- */
- uuid.hdr.nidt = NVME_NIDT_UUID;
- uuid.hdr.nidl = NVME_NIDL_UUID;
- memcpy(uuid.v, ns->params.uuid.data, NVME_NIDL_UUID);
- memcpy(pos, &uuid, sizeof(uuid));
- pos += sizeof(uuid);
+ if (!qemu_uuid_is_null(&ns->params.uuid)) {
+ uuid.hdr.nidt = NVME_NIDT_UUID;
+ uuid.hdr.nidl = NVME_NIDL_UUID;
+ memcpy(uuid.v, ns->params.uuid.data, NVME_NIDL_UUID);
+ memcpy(pos, &uuid, sizeof(uuid));
+ pos += sizeof(uuid);
+ }
if (ns->params.eui64) {
eui64.hdr.nidt = NVME_NIDT_EUI64;
--
2.36.1
- [PULL 00/11] hw/nvme updates, Klaus Jensen, 2022/06/03
- [PULL 01/11] hw/nvme: fix narrowing conversion, Klaus Jensen, 2022/06/03
- [PULL 02/11] hw/nvme: add missing return statement, Klaus Jensen, 2022/06/03
- [PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces, Klaus Jensen, 2022/06/03
- [PULL 04/11] hw/nvme: fix smart aen, Klaus Jensen, 2022/06/03
- [PULL 05/11] hw/nvme: enforce common serial per subsystem, Klaus Jensen, 2022/06/03
- [PULL 06/11] hw/nvme: do not auto-generate eui64, Klaus Jensen, 2022/06/03
- [PULL 07/11] hw/nvme: do not auto-generate uuid, Klaus Jensen, 2022/06/03
- [PULL 08/11] hw/nvme: do not report null uuid,
Klaus Jensen <=
- [PULL 09/11] hw/nvme: bump firmware revision, Klaus Jensen, 2022/06/03
- [PULL 10/11] hw/nvme: deprecate the use-intel-id compatibility parameter, Klaus Jensen, 2022/06/03
- [PULL 11/11] hw/nvme: add new command abort case, Klaus Jensen, 2022/06/03
- Re: [PULL 00/11] hw/nvme updates, Richard Henderson, 2022/06/03