hw/block/nvme: provide the mandatory subnqn field
The SUBNQN field is mandatory in NVM Express 1.3. Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20200706061303.246057-18-its@irrelevant.dk>
This commit is contained in:
parent
9e7ecdca26
commit
ccbefdb51d
@ -2168,6 +2168,7 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
|
|||||||
{
|
{
|
||||||
NvmeIdCtrl *id = &n->id_ctrl;
|
NvmeIdCtrl *id = &n->id_ctrl;
|
||||||
uint8_t *pci_conf = pci_dev->config;
|
uint8_t *pci_conf = pci_dev->config;
|
||||||
|
char *subnqn;
|
||||||
|
|
||||||
id->vid = cpu_to_le16(pci_get_word(pci_conf + PCI_VENDOR_ID));
|
id->vid = cpu_to_le16(pci_get_word(pci_conf + PCI_VENDOR_ID));
|
||||||
id->ssvid = cpu_to_le16(pci_get_word(pci_conf + PCI_SUBSYSTEM_VENDOR_ID));
|
id->ssvid = cpu_to_le16(pci_get_word(pci_conf + PCI_SUBSYSTEM_VENDOR_ID));
|
||||||
@ -2206,6 +2207,10 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
|
|||||||
id->oncs = cpu_to_le16(NVME_ONCS_WRITE_ZEROS | NVME_ONCS_TIMESTAMP |
|
id->oncs = cpu_to_le16(NVME_ONCS_WRITE_ZEROS | NVME_ONCS_TIMESTAMP |
|
||||||
NVME_ONCS_FEATURES);
|
NVME_ONCS_FEATURES);
|
||||||
|
|
||||||
|
subnqn = g_strdup_printf("nqn.2019-08.org.qemu:%s", n->params.serial);
|
||||||
|
strpadcpy((char *)id->subnqn, sizeof(id->subnqn), subnqn, '\0');
|
||||||
|
g_free(subnqn);
|
||||||
|
|
||||||
id->psd[0].mp = cpu_to_le16(0x9c4);
|
id->psd[0].mp = cpu_to_le16(0x9c4);
|
||||||
id->psd[0].enlat = cpu_to_le32(0x10);
|
id->psd[0].enlat = cpu_to_le32(0x10);
|
||||||
id->psd[0].exlat = cpu_to_le32(0x4);
|
id->psd[0].exlat = cpu_to_le32(0x4);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user