summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell2020-03-17 18:41:48 +0100
committerPeter Maydell2020-03-17 18:41:48 +0100
commitcc818a2148c5f321bdeb8e5564bdb2914e824600 (patch)
treec13bd493b763f8884c425bcd3ee2e6772097b7ba
parentMerge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-mar-17-2020' ... (diff)
parentblock/io: fix bdrv_co_do_copy_on_readv (diff)
downloadqemu-cc818a2148c5f321bdeb8e5564bdb2914e824600.tar.gz
qemu-cc818a2148c5f321bdeb8e5564bdb2914e824600.tar.xz
qemu-cc818a2148c5f321bdeb8e5564bdb2914e824600.zip
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request # gpg: Signature made Tue 17 Mar 2020 15:18:23 GMT # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: block/io: fix bdrv_co_do_copy_on_readv Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--block/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/io.c b/block/io.c
index 7e4cb74cf4..aba67f66b9 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1399,7 +1399,7 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child,
if (!(flags & BDRV_REQ_PREFETCH)) {
qemu_iovec_from_buf(qiov, qiov_offset + progress,
bounce_buffer + skip_bytes,
- pnum - skip_bytes);
+ MIN(pnum - skip_bytes, bytes - progress));
}
} else if (!(flags & BDRV_REQ_PREFETCH)) {
/* Read directly into the destination */