diff --git a/block/block-backend.c b/block/block-backend.c index 4c704a134fce25269c065711adda369bfc8fc71e..76ea45955ffed09fa599d80b3fa200cde4a0d04c 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1493,7 +1493,7 @@ int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *buf, return ret; } - return bdrv_pwrite_compressed(blk_bs(blk), offset, buf, count); + return bdrv_pwrite_compressed(blk->root, offset, buf, count); } int blk_truncate(BlockBackend *blk, int64_t offset) diff --git a/block/io.c b/block/io.c index da874d0f1930f5515ea3079c023f9003f1e2875a..c528fead1bc5de2e40a31f8447119d708a45c9f9 100644 --- a/block/io.c +++ b/block/io.c @@ -1868,9 +1868,10 @@ int bdrv_is_allocated_above(BlockDriverState *top, return 0; } -int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, +int bdrv_pwrite_compressed(BdrvChild *child, int64_t offset, const void *buf, int bytes) { + BlockDriverState *bs = child->bs; BlockDriver *drv = bs->drv; int ret; diff --git a/include/block/block.h b/include/block/block.h index b4a97f2612017c883b65bfeae7b2d1b4f8361439..7bb5ddbf73349658496546b1b3785f98aa872a4b 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -399,7 +399,7 @@ const char *bdrv_get_node_name(const BlockDriverState *bs); const char *bdrv_get_device_name(const BlockDriverState *bs); const char *bdrv_get_device_or_node_name(const BlockDriverState *bs); int bdrv_get_flags(BlockDriverState *bs); -int bdrv_pwrite_compressed(BlockDriverState *bs, int64_t offset, +int bdrv_pwrite_compressed(BdrvChild *child, int64_t offset, const void *buf, int bytes); int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs);