]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0038-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch
update submodule and patches to QEMU 8.1.5
[pve-qemu.git] / debian / patches / pve / 0038-block-io-accept-NULL-qiov-in-bdrv_pad_request.patch
CommitLineData
677d0d16
SR
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Stefan Reiter <s.reiter@proxmox.com>
3Date: Tue, 2 Mar 2021 16:11:54 +0100
4Subject: [PATCH] block/io: accept NULL qiov in bdrv_pad_request
5
6Some operations, e.g. block-stream, perform reads while discarding the
7results (only copy-on-read matters). In this case they will pass NULL as
8the target QEMUIOVector, which will however trip bdrv_pad_request, since
9it wants to extend its passed vector.
10
11Simply check for NULL and do nothing, there's no reason to pad the
12target if it will be discarded anyway.
ddbf7a87
TL
13
14Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
677d0d16 15---
8dca018b
SR
16 block/io.c | 4 ++++
17 1 file changed, 4 insertions(+)
677d0d16
SR
18
19diff --git a/block/io.c b/block/io.c
4b7975e7 20index 83d1b1dfdc..24a3c84c93 100644
677d0d16
SR
21--- a/block/io.c
22+++ b/block/io.c
10e10933
FE
23@@ -1710,6 +1710,10 @@ static int bdrv_pad_request(BlockDriverState *bs,
24 int sliced_niov;
25 size_t sliced_head, sliced_tail;
677d0d16 26
8dca018b
SR
27+ if (!qiov) {
28+ return 0;
677d0d16
SR
29+ }
30+
10e10933
FE
31 /* Should have been checked by the caller already */
32 ret = bdrv_check_request32(*offset, *bytes, *qiov, *qiov_offset);
33 if (ret < 0) {