From ed3d2ec98a33fbdeabc471b11ff807075f07e996 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Tue, 28 Mar 2017 22:51:27 +0200 Subject: block: Add errp to b{lk,drv}_truncate() For one thing, this allows us to drop the error message generation from qemu-img.c and blockdev.c and instead have it unified in bdrv_truncate(). Signed-off-by: Max Reitz Message-id: 20170328205129.15138-3-mreitz@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- block/commit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'block/commit.c') diff --git a/block/commit.c b/block/commit.c index 91d2c34..76a0d98 100644 --- a/block/commit.c +++ b/block/commit.c @@ -151,7 +151,7 @@ static void coroutine_fn commit_run(void *opaque) } if (base_len < s->common.len) { - ret = blk_truncate(s->base, s->common.len); + ret = blk_truncate(s->base, s->common.len, NULL); if (ret) { goto out; } @@ -511,8 +511,9 @@ int bdrv_commit(BlockDriverState *bs) * grow the backing file image if possible. If not possible, * we must return an error */ if (length > backing_length) { - ret = blk_truncate(backing, length); + ret = blk_truncate(backing, length, &local_err); if (ret < 0) { + error_report_err(local_err); goto ro_cleanup; } } -- cgit v1.1