From f59adb325618a2d2ba16aece551e7ab6acadb0ae Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Tue, 28 Mar 2017 22:51:29 +0200 Subject: block: Add .bdrv_truncate() error messages Add missing error messages for the block driver implementations of .bdrv_truncate(); drop the generic one from block.c's bdrv_truncate(). Since one of these changes touches a mis-indented block in block/file-posix.c, this patch fixes that coding style issue along the way. Signed-off-by: Max Reitz Message-id: 20170328205129.15138-5-mreitz@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- block/gluster.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'block/gluster.c') diff --git a/block/gluster.c b/block/gluster.c index be45c08b4c..1d4e2f7c52 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -1100,7 +1100,9 @@ static int qemu_gluster_truncate(BlockDriverState *bs, int64_t offset, ret = glfs_ftruncate(s->fd, offset); if (ret < 0) { - return -errno; + ret = -errno; + error_setg_errno(errp, -ret, "Failed to truncate file"); + return ret; } return 0; -- cgit v1.2.3