From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bkq-0003sf-I3 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:50:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bkn-0007Wj-ND for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:50:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bkn-0007WN-Il for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:50:09 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 33C28744 for ; Thu, 17 Dec 2015 16:50:09 +0000 (UTC) Received: from blackfin.pond.sub.org ([10.3.113.12]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBHGo7cT005146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 17 Dec 2015 11:50:08 -0500 From: Markus Armbruster Date: Thu, 17 Dec 2015 17:49:47 +0100 Message-Id: <1450371004-26866-7-git-send-email-armbru@redhat.com> In-Reply-To: <1450371004-26866-1-git-send-email-armbru@redhat.com> References: <1450371004-26866-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 06/23] block: Clean up "Could not create temporary overlay" error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- block.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 3a7324b..4b0845e 100644 --- a/block.c +++ b/block.c @@ -1336,9 +1336,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; } -- 2.4.3