mirror of https://github.com/xemu-project/xemu.git
hw/nvme: do not report null uuid
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>
This commit is contained in:
parent
bd9f371c6f
commit
9f2e1acf83
|
@ -4955,16 +4955,13 @@ static uint16_t nvme_identify_ns_descr_list(NvmeCtrl *n, NvmeRequest *req)
|
||||||
return NVME_INVALID_FIELD | NVME_DNR;
|
return NVME_INVALID_FIELD | NVME_DNR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (!qemu_uuid_is_null(&ns->params.uuid)) {
|
||||||
* If the EUI-64 field is 0 and the NGUID field is 0, the namespace must
|
uuid.hdr.nidt = NVME_NIDT_UUID;
|
||||||
* provide a valid Namespace UUID in the Namespace Identification Descriptor
|
uuid.hdr.nidl = NVME_NIDL_UUID;
|
||||||
* data structure. QEMU does not yet support setting NGUID.
|
memcpy(uuid.v, ns->params.uuid.data, NVME_NIDL_UUID);
|
||||||
*/
|
memcpy(pos, &uuid, sizeof(uuid));
|
||||||
uuid.hdr.nidt = NVME_NIDT_UUID;
|
pos += sizeof(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) {
|
if (ns->params.eui64) {
|
||||||
eui64.hdr.nidt = NVME_NIDT_EUI64;
|
eui64.hdr.nidt = NVME_NIDT_EUI64;
|
||||||
|
|
Loading…
Reference in New Issue