]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: Add bdrv_supports_compressed_writes()
authorMax Reitz <mreitz@redhat.com>
Wed, 12 Jun 2019 20:57:15 +0000 (22:57 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 7 Sep 2020 10:31:31 +0000 (12:31 +0200)
commitae23f78646e9635ec9cbf15dbf82a717ea1b0e69
treed2e1e4f5f006c038a18f518e80e5d483c17133ab
parent8b8277cdb05eef79bfe6b14c21dfaa027cebbd08
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>
block.c
include/block/block.h