aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKlaus Jensen <k.jensen@samsung.com>2020-02-23 16:37:49 +0100
committerKlaus Jensen <k.jensen@samsung.com>2020-09-02 08:48:50 +0200
commitd1322b46684ef38f78760acfd4861b396a9c0264 (patch)
tree179beccc005d9a199c7e64e094540028ca515b40 /hw
parent3c40434e516d1541d3f356dbad8c695447a5a7ad (diff)
downloadqemu-d1322b46684ef38f78760acfd4861b396a9c0264.zip
qemu-d1322b46684ef38f78760acfd4861b396a9c0264.tar.gz
qemu-d1322b46684ef38f78760acfd4861b396a9c0264.tar.bz2
hw/block/nvme: memset preallocated requests structures
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 <k.jensen@samsung.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block/nvme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index aa57749..8cd3043 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -668,7 +668,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);