diff mbox series

[15/15] block/nvme: Set request_alignment at initialization

Message ID 20201014155810.102841-16-philmd@redhat.com
State Superseded
Headers show
Series block/nvme: Improve debugging experience and minor fixes | expand

Commit Message

Philippe Mathieu-Daudé Oct. 14, 2020, 3:58 p.m. UTC
When introducing this driver in commit bdd6a90a9e5
("block: Add VFIO based NVMe driver") we correctly
set the request_alignment in nvme_refresh_limits()
but forgot to set it at initialization. Do it now.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 block/nvme.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/block/nvme.c b/block/nvme.c
index 4d2b7fdf4f4..04608b49f56 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -745,6 +745,7 @@  static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
     s->page_size = MAX(4096, 1 << NVME_CAP_MPSMIN(cap));
     s->doorbell_scale = (4 << NVME_CAP_DSTRD(cap)) / sizeof(uint32_t);
     bs->bl.opt_mem_alignment = s->page_size;
+    bs->bl.request_alignment = s->page_size;
     timeout_ms = MIN(500 * NVME_CAP_TO(cap), 30000);
 
     /* Reset device to get a clean state. */