From c8228ac35541564c46bf1c91ebe7951f367e2ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 29 Oct 2020 10:32:58 +0100 Subject: [PATCH] block/nvme: Set request_alignment at initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit bdd6a90a9e5 ("block: Add VFIO based NVMe driver") sets the request_alignment in nvme_refresh_limits(). For consistency, also set it during initialization. Reported-by: Stefan Hajnoczi Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-18-philmd@redhat.com Signed-off-by: Stefan Hajnoczi Tested-by: Eric Auger --- block/nvme.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nvme.c b/block/nvme.c index cd875555ca..bb75448a09 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -758,6 +758,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. */