aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2014-02-12 14:46:24 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2014-02-14 18:05:38 +0100
commit39a611a3e035e148257af314a522a6cd169c2d0e (patch)
tree754c96b3c089acd52d67861615c62116becfff47 /block/vmdk.c
parent28f106afb35a86aa01e1907ef7632e015fabce02 (diff)
downloadqemu-39a611a3e035e148257af314a522a6cd169c2d0e.zip
qemu-39a611a3e035e148257af314a522a6cd169c2d0e.tar.gz
qemu-39a611a3e035e148257af314a522a6cd169c2d0e.tar.bz2
block: Don't throw away errno via error_setg
There are a handful of places in the block layer where a failure path has a valid -errno value, yet error_setg() is used. Those instances should instead use error_setg_errno(), to preserve as much error information as possible. This patch replaces those instances with error_setg_errno(), so that errno is passed up the stack in the error message. Reported-By: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index e809e2e..ff6f5ee 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1502,7 +1502,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
if (flat) {
ret = bdrv_truncate(bs, filesize);
if (ret < 0) {
- error_setg(errp, "Could not truncate file");
+ error_setg_errno(errp, -ret, "Could not truncate file");
}
goto exit;
}
@@ -1562,7 +1562,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
ret = bdrv_truncate(bs, le64_to_cpu(header.grain_offset) << 9);
if (ret < 0) {
- error_setg(errp, "Could not truncate file");
+ error_setg_errno(errp, -ret, "Could not truncate file");
goto exit;
}
@@ -1846,7 +1846,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options,
if (desc_offset == 0) {
ret = bdrv_truncate(new_bs, desc_len);
if (ret < 0) {
- error_setg(errp, "Could not truncate file");
+ error_setg_errno(errp, -ret, "Could not truncate file");
}
}
exit: