aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-12-18 16:35:09 +0100
committerMarkus Armbruster <armbru@redhat.com>2016-01-13 15:16:16 +0100
commitcd5c2dac2e6e60b4f7048d932530cec9d3fdc5da (patch)
treee683eee5728175c1cbc8ea347f01d2b9841b760f /block.c
parentf4d0064afcff4c38b379800674938cde8f069dcd (diff)
block: Clean up "Could not create temporary overlay" error message
bdrv_create() sets an error and returns -errno on failure. When the latter is interesting, the error is created with error_setg_errno(). bdrv_append_temp_snapshot() uses the error's message to create a new one with error_setg_errno(). This adds a strerror() that is either uninteresting or duplicate. Use error_setg() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-7-git-send-email-armbru@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block.c b/block.c
index 01655ded13..b2bdff90e4 100644
--- a/block.c
+++ b/block.c
@@ -1463,9 +1463,8 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
ret = bdrv_create(&bdrv_qcow2, tmp_filename, opts, &local_err);
qemu_opts_del(opts);
if (ret < 0) {
- error_setg_errno(errp, -ret, "Could not create temporary overlay "
- "'%s': %s", tmp_filename,
- error_get_pretty(local_err));
+ error_setg(errp, "Could not create temporary overlay '%s': %s",
+ tmp_filename, error_get_pretty(local_err));
error_free(local_err);
goto out;
}