summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-02-12 14:49:50 +0100
committerKevin Wolf <kwolf@redhat.com>2015-03-10 14:02:24 +0100
commit27994d587940b0c72d5f1d69f6e1a62a02f26dc9 (patch)
treed2815db37db42438b0e9f5961254ea69cb850171 /block
parent354483e50726140d9c6cb5ff0e1698bd5f17a2d5 (diff)
downloadqemu-27994d587940b0c72d5f1d69f6e1a62a02f26dc9.tar.gz
sheepdog: Fix misleading error messages in sd_snapshot_create()
If do_sd_create() fails, it first reports the error returned, then reports a another one with strerror(errno). errno is meaningless at that point. Report just one error combining the valid information from both messages. Reported-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Liu Yuan <namei.unix@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/sheepdog.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 60a4853b64..c14172cfa6 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2339,9 +2339,8 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
ret = do_sd_create(s, &new_vid, 1, &local_err);
if (ret < 0) {
- error_report_err(local_err);
- error_report("failed to create inode for snapshot. %s",
- strerror(errno));
+ error_report("failed to create inode for snapshot: %s",
+ error_get_pretty(local_err));
goto cleanup;
}