diff options
author | Alex Friedman | 2014-12-05 13:40:24 +0100 |
---|---|---|
committer | Stefan Hajnoczi | 2015-01-13 14:43:29 +0100 |
commit | e7026f1953c16d1cc3e8310cc27db6acf61d9def (patch) | |
tree | 512bd1d20141d962e4edef6b3c575e4fec839a9e /hw/block/nvme.c | |
parent | ide: Implement VPD response for ATAPI (diff) | |
download | qemu-e7026f1953c16d1cc3e8310cc27db6acf61d9def.tar.gz qemu-e7026f1953c16d1cc3e8310cc27db6acf61d9def.tar.xz qemu-e7026f1953c16d1cc3e8310cc27db6acf61d9def.zip |
nvme: Fix get/set number of queues feature
According to the specification, the low 16 bits should contain the number of
I/O submission queues, and the high 16 bits should contain the number of
I/O completion queues.
Signed-off-by: Alex Friedman <alex@e8storage.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/block/nvme.c')
-rw-r--r-- | hw/block/nvme.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c index aa1ed986d2..4f70f91443 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -476,7 +476,8 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req) switch (dw10) { case NVME_NUMBER_OF_QUEUES: - req->cqe.result = cpu_to_le32(n->num_queues); + req->cqe.result = + cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16)); break; default: return NVME_INVALID_FIELD | NVME_DNR; @@ -490,7 +491,8 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req) switch (dw10) { case NVME_NUMBER_OF_QUEUES: - req->cqe.result = cpu_to_le32(n->num_queues); + req->cqe.result = + cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16)); break; default: return NVME_INVALID_FIELD | NVME_DNR; |