From patchwork Mon Nov 3 12:40:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 406136 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9C0E7140081 for ; Mon, 3 Nov 2014 23:43:34 +1100 (AEDT) Received: from localhost ([::1]:34259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGyq-0005oE-Kt for incoming@patchwork.ozlabs.org; Mon, 03 Nov 2014 07:43:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGwT-00025M-Q3 for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:41:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlGwI-0006zq-Jd for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:41:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGwI-0006zi-89 for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:40:54 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA3CeoN4020387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Nov 2014 07:40:50 -0500 Received: from localhost (dhcp-192-247.str.redhat.com [10.33.192.247]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA3CemQs025650 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 3 Nov 2014 07:40:49 -0500 From: Max Reitz To: qemu-devel@nongnu.org Date: Mon, 3 Nov 2014 13:40:47 +0100 Message-Id: <1415018447-22910-1-git-send-email-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Peter Lieven , Stefan Hajnoczi , Max Reitz Subject: [Qemu-devel] [PATCH] qemu-img: Omit error_report() after img_open() 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 img_open() already prints an error if the operation failed, so there should not be another error_report() afterwards. Signed-off-by: Max Reitz Reviewed-by: Markus Armbruster --- qemu-img.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 66a7eb4..a42335c 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1126,7 +1126,6 @@ static int img_compare(int argc, char **argv) blk1 = img_open("image_1", filename1, fmt1, flags, true, quiet); if (!blk1) { - error_report("Can't open file %s", filename1); ret = 2; goto out3; } @@ -1134,7 +1133,6 @@ static int img_compare(int argc, char **argv) blk2 = img_open("image_2", filename2, fmt2, flags, true, quiet); if (!blk2) { - error_report("Can't open file %s", filename2); ret = 2; goto out2; } @@ -1482,7 +1480,6 @@ static int img_convert(int argc, char **argv) true, quiet); g_free(id); if (!blk[bs_i]) { - error_report("Could not open '%s'", argv[optind + bs_i]); ret = -1; goto out; } @@ -2962,7 +2959,6 @@ static int img_amend(int argc, char **argv) blk = img_open("image", filename, fmt, flags, true, quiet); if (!blk) { - error_report("Could not open image '%s'", filename); ret = -1; goto out; }