From 4bff28b81a0ddb48a09d279e99ab847e8a292506 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Tue, 28 Mar 2017 22:51:28 +0200 Subject: block: Add errp to BD.bdrv_truncate() Add an Error parameter to the block drivers' bdrv_truncate() interface. If a block driver does not set this in case of an error, the generic bdrv_truncate() implementation will do so. Where it is obvious, this patch also makes some block drivers set this value. Signed-off-by: Max Reitz Message-id: 20170328205129.15138-4-mreitz@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- block/blkdebug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'block/blkdebug.c') diff --git a/block/blkdebug.c b/block/blkdebug.c index 9bd066e0df..d2a7561c4c 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -659,9 +659,9 @@ static int64_t blkdebug_getlength(BlockDriverState *bs) return bdrv_getlength(bs->file->bs); } -static int blkdebug_truncate(BlockDriverState *bs, int64_t offset) +static int blkdebug_truncate(BlockDriverState *bs, int64_t offset, Error **errp) { - return bdrv_truncate(bs->file, offset, NULL); + return bdrv_truncate(bs->file, offset, errp); } static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options) -- cgit v1.2.1