From: Markus Armbruster Date: Thu, 12 Feb 2015 13:49:50 +0000 (+0100) Subject: sheepdog: Fix misleading error messages in sd_snapshot_create() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=27994d587940b0c72d5f1d69f6e1a62a02f26dc9;p=qemu.git 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 Signed-off-by: Markus Armbruster Reviewed-by: Liu Yuan Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- 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; }