1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Stefan Reiter <s.reiter@proxmox.com>
3 Date: Tue, 2 Mar 2021 16:11:54 +0100
4 Subject: [PATCH] block/io: accept NULL qiov in bdrv_pad_request
6 Some operations, e.g. block-stream, perform reads while discarding the
7 results (only copy-on-read matters). In this case they will pass NULL as
8 the target QEMUIOVector, which will however trip bdrv_pad_request, since
9 it wants to extend its passed vector.
11 Simply check for NULL and do nothing, there's no reason to pad the
12 target if it will be discarded anyway.
14 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 1 file changed, 4 insertions(+)
19 diff --git a/block/io.c b/block/io.c
20 index 055fcf7438..63f7b3ad3e 100644
23 @@ -1710,6 +1710,10 @@ static int bdrv_pad_request(BlockDriverState *bs,
25 size_t sliced_head, sliced_tail;
31 /* Should have been checked by the caller already */
32 ret = bdrv_check_request32(*offset, *bytes, *qiov, *qiov_offset);