From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nmp9M-0001BT-HB for qemu-devel@nongnu.org; Wed, 03 Mar 2010 09:02:08 -0500 Received: from [199.232.76.173] (port=52636 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nmp9M-0001B2-4A for qemu-devel@nongnu.org; Wed, 03 Mar 2010 09:02:08 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nmp9L-0003Nt-9n for qemu-devel@nongnu.org; Wed, 03 Mar 2010 09:02:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44604) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nmp9K-0003Np-Tl for qemu-devel@nongnu.org; Wed, 03 Mar 2010 09:02:07 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o23E25Iq022696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Mar 2010 09:02:06 -0500 Message-ID: <4B8E6BB2.7040606@redhat.com> Date: Wed, 03 Mar 2010 15:01:22 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <92764ba73c7a75e8747b7a5a58a4a1ccb3d51489.1267617582.git.quintela@redhat.com> In-Reply-To: <92764ba73c7a75e8747b7a5a58a4a1ccb3d51489.1267617582.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 10/10] block: print errno on error List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: amit.shah@redhat.com, qemu-devel@nongnu.org Am 03.03.2010 13:07, schrieb Juan Quintela: > 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..f6c40fb 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("Error (%s) while formatting for file format '%s'", strerror(ret), fmt); > } > } > 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("Error (%s) while formatting file '%s'", strerror(ret), out_filename); > } > } > I think it should be strerror(-ret) in both cases. Kevin