diff mbox

[1/2] nvme: fix identify to be NVMe 1.1 compliant

Message ID 20151118192109.GA11825@lst.de
State New
Headers show

Commit Message

Christoph Hellwig Nov. 18, 2015, 7:21 p.m. UTC
Meh, this was still missing the uncommited changes for the nsid
off by one vs the array index:
diff mbox

Patch

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 360be71..4f768d5 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -499,10 +499,10 @@  static uint16_t nvme_identify_nslist(NvmeCtrl *n, NvmeIdentify *c)
 
     list = g_malloc0(data_len);
     for (i = 0; i < n->num_namespaces; i++) {
-        if (i <= min_nsid) {
+        if (i < min_nsid) {
             continue;
         }
-        list[j++] = cpu_to_le32(i);
+        list[j++] = cpu_to_le32(i + 1);
         if (j == data_len / sizeof(uint32_t)) {
             break;
         }