From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUGXN-0001wf-64 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 09:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUGXH-0007j3-5y for qemu-devel@nongnu.org; Thu, 10 Oct 2013 09:44:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUGXG-0007is-T3 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 09:44:15 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9ADiEdK017178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Oct 2013 09:44:14 -0400 From: Max Reitz Date: Thu, 10 Oct 2013 15:44:03 +0200 Message-Id: <1381412644-16212-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1381412644-16212-1-git-send-email-mreitz@redhat.com> References: <1381412644-16212-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 4/5] blkdebug: Employ error parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz Make use of the error parameter in blkdebug_open. Signed-off-by: Max Reitz --- block/blkdebug.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index be948b2..16d2b91 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -362,8 +362,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, opts = qemu_opts_create_nofail(&runtime_opts); qemu_opts_absorb_qdict(opts, options, &local_err); if (error_is_set(&local_err)) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); ret = -EINVAL; goto fail; } @@ -373,6 +372,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, if (config) { ret = read_config(s, config); if (ret < 0) { + error_setg_errno(errp, -ret, "Could not read blkdebug config file"); goto fail; } } @@ -383,14 +383,14 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, /* Open the backing file */ filename = qemu_opt_get(opts, "x-image"); if (filename == NULL) { + error_setg(errp, "Could not retrieve image file name"); ret = -EINVAL; goto fail; } ret = bdrv_file_open(&bs->file, filename, NULL, flags, &local_err); if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); goto fail; } -- 1.8.3.1