summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorMax Reitz2019-06-12 22:57:15 +0200
committerKevin Wolf2020-09-07 12:31:31 +0200
commitae23f78646e9635ec9cbf15dbf82a717ea1b0e69 (patch)
treed2e1e4f5f006c038a18f518e80e5d483c17133ab /include/block
parentblock: Drop bdrv_is_encrypted() (diff)
downloadqemu-ae23f78646e9635ec9cbf15dbf82a717ea1b0e69.tar.gz
qemu-ae23f78646e9635ec9cbf15dbf82a717ea1b0e69.tar.xz
qemu-ae23f78646e9635ec9cbf15dbf82a717ea1b0e69.zip
block: Add bdrv_supports_compressed_writes()
Filters cannot compress data themselves but they have to implement .bdrv_co_pwritev_compressed() still (or they cannot forward compressed writes). Therefore, checking whether bs->drv->bdrv_co_pwritev_compressed is non-NULL is not sufficient to know whether the node can actually handle compressed writes. This function looks down the filter chain to see whether there is a non-filter that can actually convert the compressed writes into compressed data (and thus normal writes). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 2c09b93d07..981ab5b314 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -532,6 +532,7 @@ BlockDriverState *bdrv_next(BdrvNextIterator *it);
void bdrv_next_cleanup(BdrvNextIterator *it);
BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs);
+bool bdrv_supports_compressed_writes(BlockDriverState *bs);
void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
void *opaque, bool read_only);
const char *bdrv_get_node_name(const BlockDriverState *bs);