From patchwork Thu Mar 4 09:00:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 46898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DE6B2B7CEC for ; Thu, 4 Mar 2010 20:29:43 +1100 (EST) Received: from localhost ([127.0.0.1]:50624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn7ND-0001CE-A2 for incoming@patchwork.ozlabs.org; Thu, 04 Mar 2010 04:29:39 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nn6vX-0003uI-Ku for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:01:04 -0500 Received: from [199.232.76.173] (port=45419 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nn6vW-0003tu-HP for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:01:02 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nn6vV-0004Uy-78 for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:01:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5221) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nn6vU-0004Ub-JC for qemu-devel@nongnu.org; Thu, 04 Mar 2010 04:01:01 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2490xFb014519 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Mar 2010 04:00:59 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2490etc010016; Thu, 4 Mar 2010 04:00:57 -0500 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 4 Mar 2010 10:00:38 +0100 Message-Id: <5fd84f921f650fac8af52e0606350280a5558d92.1267692963.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 09/10] block: print errno on error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Now that we changed all create calls to return errno, just print it. Signed-off-by: Juan Quintela --- qemu-img.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 0c9f2d4..e51b40c 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -374,7 +374,7 @@ static int img_create(int argc, char **argv) } else if (ret == -EFBIG) { error("The image size is too large for file format '%s'", fmt); } else { - error("Error while formatting"); + error("%s: error while creating %s: %s", filename, fmt, strerror(-ret)); } } return 0; @@ -687,7 +687,7 @@ static int img_convert(int argc, char **argv) } else if (ret == -EFBIG) { error("The image size is too large for file format '%s'", out_fmt); } else { - error("Error while formatting '%s'", out_filename); + error("%s: error while converting %s: %s", out_filename, out_fmt, strerror(-ret)); } }