All of lore.kernel.org
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: "Yanan Wang" <wangyanan55@huawei.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	libvir-list@redhat.com,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Fam Zheng" <fam@euphon.net>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	qemu-block@nongnu.org, "Klaus Jensen" <its@irrelevant.dk>,
	"Keith Busch" <kbusch@kernel.org>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Klaus Jensen" <k.jensen@samsung.com>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Christoph Hellwig" <hch@lst.de>
Subject: [PULL 08/11] hw/nvme: do not report null uuid
Date: Fri,  3 Jun 2022 21:53:51 +0200	[thread overview]
Message-ID: <20220603195354.705516-9-its@irrelevant.dk> (raw)
In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk>

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



  parent reply	other threads:[~2022-06-03 20:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 19:53 [PULL 00/11] hw/nvme updates Klaus Jensen
2022-06-03 19:53 ` [PULL 01/11] hw/nvme: fix narrowing conversion Klaus Jensen
2022-06-03 19:53 ` [PULL 02/11] hw/nvme: add missing return statement Klaus Jensen
2022-06-03 19:53 ` [PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces Klaus Jensen
2022-06-03 19:53 ` [PULL 04/11] hw/nvme: fix smart aen Klaus Jensen
2022-06-03 19:53 ` [PULL 05/11] hw/nvme: enforce common serial per subsystem Klaus Jensen
2022-06-03 19:53 ` [PULL 06/11] hw/nvme: do not auto-generate eui64 Klaus Jensen
2022-06-03 19:53 ` [PULL 07/11] hw/nvme: do not auto-generate uuid Klaus Jensen
2022-06-03 19:53 ` Klaus Jensen [this message]
2022-06-03 19:53 ` [PULL 09/11] hw/nvme: bump firmware revision Klaus Jensen
2022-06-03 19:53 ` [PULL 10/11] hw/nvme: deprecate the use-intel-id compatibility parameter Klaus Jensen
2022-06-03 19:53 ` [PULL 11/11] hw/nvme: add new command abort case Klaus Jensen
2022-06-04  2:31 ` [PULL 00/11] hw/nvme updates Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220603195354.705516-9-its@irrelevant.dk \
    --to=its@irrelevant.dk \
    --cc=eduardo@habkost.net \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=hch@lst.de \
    --cc=hreitz@redhat.com \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mcgrof@kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wangyanan55@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.