qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v6 22/42] nvme: memset preallocated requests structures


From: Klaus Jensen
Subject: [PATCH v6 22/42] nvme: memset preallocated requests structures
Date: Mon, 16 Mar 2020 07:29:08 -0700

From: Klaus Jensen <address@hidden>

This is preparatory to subsequent patches that change how QSGs/IOVs are
handled. It is important that the qsg and iov members of the NvmeRequest
are initially zeroed.

Signed-off-by: Klaus Jensen <address@hidden>
---
 hw/block/nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 26c4b6e69f72..08267e847671 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -597,7 +597,7 @@ static void nvme_init_sq(NvmeSQueue *sq, NvmeCtrl *n, 
uint64_t dma_addr,
     sq->size = size;
     sq->cqid = cqid;
     sq->head = sq->tail = 0;
-    sq->io_req = g_new(NvmeRequest, sq->size);
+    sq->io_req = g_new0(NvmeRequest, sq->size);
 
     QTAILQ_INIT(&sq->req_list);
     QTAILQ_INIT(&sq->out_req_list);
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]