From patchwork Thu Oct 10 13:44:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 282263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F40732C0079 for ; Fri, 11 Oct 2013 00:47:28 +1100 (EST) Received: from localhost ([::1]:47233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUGaN-0005s6-5S for incoming@patchwork.ozlabs.org; Thu, 10 Oct 2013 09:47:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUGXP-0001x2-DW for qemu-devel@nongnu.org; Thu, 10 Oct 2013 09:44:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUGXJ-0007jZ-Cj for qemu-devel@nongnu.org; Thu, 10 Oct 2013 09:44:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUGXJ-0007jM-3y for qemu-devel@nongnu.org; Thu, 10 Oct 2013 09:44:17 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9ADiGGL017188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Oct 2013 09:44:16 -0400 Received: from localhost (dhcp-200-247.str.redhat.com [10.33.200.247]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9ADiEx9012414 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 10 Oct 2013 09:44:15 -0400 From: Max Reitz To: qemu-devel@nongnu.org Date: Thu, 10 Oct 2013 15:44:04 +0200 Message-Id: <1381412644-16212-6-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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz Subject: [Qemu-devel] [PATCH 5/5] blkverify: Employ error parameter X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Make use of the error parameter in blkverify_open. Signed-off-by: Max Reitz --- block/blkverify.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block/blkverify.c b/block/blkverify.c index 1e8e6d9..3c63528 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -128,8 +128,7 @@ static int blkverify_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; } @@ -137,20 +136,21 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, /* Parse the raw image filename */ raw = qemu_opt_get(opts, "x-raw"); if (raw == NULL) { + error_setg(errp, "Could not retrieve raw image filename"); ret = -EINVAL; goto fail; } ret = bdrv_file_open(&bs->file, raw, NULL, flags, &local_err); if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); goto fail; } /* Open the test file */ filename = qemu_opt_get(opts, "x-image"); if (filename == NULL) { + error_setg(errp, "Could not retrieve test image filename"); ret = -EINVAL; goto fail; } @@ -158,8 +158,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, s->test_file = bdrv_new(""); ret = bdrv_open(s->test_file, filename, NULL, flags, NULL, &local_err); if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); bdrv_unref(s->test_file); s->test_file = NULL; goto fail;