From patchwork Tue Sep 10 14:49:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 273895 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 163CF2C0340 for ; Wed, 11 Sep 2013 00:54:24 +1000 (EST) Received: from localhost ([::1]:58469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJPKf-0001cc-JS for incoming@patchwork.ozlabs.org; Tue, 10 Sep 2013 10:54:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJPHV-00056L-Ft for qemu-devel@nongnu.org; Tue, 10 Sep 2013 10:51:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJPHP-0006rZ-8o for qemu-devel@nongnu.org; Tue, 10 Sep 2013 10:51:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJPHP-0006rI-1S for qemu-devel@nongnu.org; Tue, 10 Sep 2013 10:50:59 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8AEow5V015658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 10 Sep 2013 10:50:58 -0400 Received: from localhost (dhcp-200-247.str.redhat.com [10.33.200.247]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r8AEouV4012683 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 10 Sep 2013 10:50:57 -0400 From: Max Reitz To: qemu-devel@nongnu.org Date: Tue, 10 Sep 2013 16:49:36 +0200 Message-Id: <1378824578-30394-6-git-send-email-mreitz@redhat.com> In-Reply-To: <1378824578-30394-1-git-send-email-mreitz@redhat.com> References: <1378824578-30394-1-git-send-email-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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/7] qemu-img create: Emit filename on error 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 bdrv_img_create generally does not emit the target filename, although this is pretty important information. Therefore, prepend its error message with the output filename (if an error occurs). Signed-off-by: Max Reitz --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index a8b82ad..20d8c02 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -412,7 +412,7 @@ static int img_create(int argc, char **argv) bdrv_img_create(filename, fmt, base_filename, base_fmt, options, img_size, BDRV_O_FLAGS, &local_err, quiet); if (error_is_set(&local_err)) { - error_report("%s", error_get_pretty(local_err)); + error_report("%s: %s", filename, error_get_pretty(local_err)); error_free(local_err); return 1; }