aboutsummaryrefslogtreecommitdiff
path: root/block/throttle.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-06-12 22:52:27 +0200
committerKevin Wolf <kwolf@redhat.com>2020-09-07 12:31:31 +0200
commite7e754aec3aca3a509d8826cc9a6e6136e9aca65 (patch)
tree57ef6bd864650bf222a4e53e93850232af5936a2 /block/throttle.c
parentae23f78646e9635ec9cbf15dbf82a717ea1b0e69 (diff)
downloadqemu-e7e754aec3aca3a509d8826cc9a6e6136e9aca65.zip
qemu-e7e754aec3aca3a509d8826cc9a6e6136e9aca65.tar.gz
qemu-e7e754aec3aca3a509d8826cc9a6e6136e9aca65.tar.bz2
throttle: Support compressed writes
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/throttle.c')
-rw-r--r--block/throttle.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block/throttle.c b/block/throttle.c
index 1c1ac57..b21ee42 100644
--- a/block/throttle.c
+++ b/block/throttle.c
@@ -151,6 +151,15 @@ static int coroutine_fn throttle_co_pdiscard(BlockDriverState *bs,
return bdrv_co_pdiscard(bs->file, offset, bytes);
}
+static int coroutine_fn throttle_co_pwritev_compressed(BlockDriverState *bs,
+ uint64_t offset,
+ uint64_t bytes,
+ QEMUIOVector *qiov)
+{
+ return throttle_co_pwritev(bs, offset, bytes, qiov,
+ BDRV_REQ_WRITE_COMPRESSED);
+}
+
static int throttle_co_flush(BlockDriverState *bs)
{
return bdrv_co_flush(bs->file->bs);
@@ -243,6 +252,7 @@ static BlockDriver bdrv_throttle = {
.bdrv_co_pwrite_zeroes = throttle_co_pwrite_zeroes,
.bdrv_co_pdiscard = throttle_co_pdiscard,
+ .bdrv_co_pwritev_compressed = throttle_co_pwritev_compressed,
.bdrv_attach_aio_context = throttle_attach_aio_context,
.bdrv_detach_aio_context = throttle_detach_aio_context,