]> Git Repo - qemu.git/commitdiff
block: Clean up "Could not create temporary overlay" error message
authorMarkus Armbruster <[email protected]>
Fri, 18 Dec 2015 15:35:09 +0000 (16:35 +0100)
committerMarkus Armbruster <[email protected]>
Wed, 13 Jan 2016 14:16:16 +0000 (15:16 +0100)
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 <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <1450452927[email protected]>

block.c

diff --git a/block.c b/block.c
index 01655ded13db44f816be677df1db25cae58aef0a..b2bdff90e4d8640cce62eabd5f1f00b2aad8c540 100644 (file)
--- 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;
     }
This page took 0.046934 seconds and 4 git commands to generate.