block: Don't throw away errno via error_setg
authorJeff Cody <jcody@redhat.com>
Wed, 12 Feb 2014 19:46:24 +0000 (14:46 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 14 Feb 2014 17:05:38 +0000 (18:05 +0100)
commit39a611a3e035e148257af314a522a6cd169c2d0e
tree754c96b3c089acd52d67861615c62116becfff47
parent28f106afb35a86aa01e1907ef7632e015fabce02
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>
block/mirror.c
block/qcow2-snapshot.c
block/vmdk.c