From 7ea37c30660d4cd6aca21a324fabefe23b89f931 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Tue, 13 Jun 2017 22:20:53 +0200 Subject: block: Add PreallocMode to bdrv_truncate() For block drivers that just pass a truncate request to the underlying protocol, we can now pass the preallocation mode instead of aborting if it is not PREALLOC_MODE_OFF. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-3-mreitz@redhat.com Signed-off-by: Max Reitz --- include/block/block.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/block/block.h') diff --git a/include/block/block.h b/include/block/block.h index 96edc85129..b3e2674845 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -302,7 +302,8 @@ BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, const char *backing_file); int bdrv_get_backing_file_depth(BlockDriverState *bs); void bdrv_refresh_filename(BlockDriverState *bs); -int bdrv_truncate(BdrvChild *child, int64_t offset, Error **errp); +int bdrv_truncate(BdrvChild *child, int64_t offset, PreallocMode prealloc, + Error **errp); int64_t bdrv_nb_sectors(BlockDriverState *bs); int64_t bdrv_getlength(BlockDriverState *bs); int64_t bdrv_get_allocated_file_size(BlockDriverState *bs); -- cgit v1.2.1