]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/pve/0047-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch
b294d438b2edd82197dd146886dd073a77a41440
[pve-qemu.git] / debian / patches / pve / 0047-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch
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
5
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.
10
11 Simply check for NULL and do nothing, there's no reason to pad the
12 target if it will be discarded anyway.
13
14 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 ---
16 block/io.c | 4 ++++
17 1 file changed, 4 insertions(+)
18
19 diff --git a/block/io.c b/block/io.c
20 index 0a8cbefe86..531b3b7a2d 100644
21 --- a/block/io.c
22 +++ b/block/io.c
23 @@ -1734,6 +1734,10 @@ static int bdrv_pad_request(BlockDriverState *bs,
24 {
25 int ret;
26
27 + if (!qiov) {
28 + return 0;
29 + }
30 +
31 bdrv_check_qiov_request(*offset, *bytes, *qiov, *qiov_offset, &error_abort);
32
33 if (!bdrv_init_padding(bs, *offset, *bytes, pad)) {