Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmrJt-0000Dv-HA for qemu-devel@nongnu.org; Wed, 03 Mar 2010 11:21:09 -0500 Received: from [199.232.76.173] (port=33783 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmrJs-0000Dl-5o for qemu-devel@nongnu.org; Wed, 03 Mar 2010 11:21:08 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmrJp-00026P-23 for qemu-devel@nongnu.org; Wed, 03 Mar 2010 11:21:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52977) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NmrJo-00026J-Ke for qemu-devel@nongnu.org; Wed, 03 Mar 2010 11:21:04 -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 o23GL3PE021641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Mar 2010 11:21:03 -0500 From: Juan Quintela In-Reply-To: <4B8E73D4.4090205@redhat.com> (Paolo Bonzini's message of "Wed, 03 Mar 2010 15:36:04 +0100") References: <92764ba73c7a75e8747b7a5a58a4a1ccb3d51489.1267617582.git.quintela@redhat.com> <4B8E6BB2.7040606@redhat.com> <4B8E73D4.4090205@redhat.com> Date: Wed, 03 Mar 2010 17:21:00 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Paolo Bonzini Cc: Kevin Wolf , amit.shah@redhat.com, qemu-devel@nongnu.org Paolo Bonzini wrote: >>> 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. oops, yes. > Yes; also, since you are at it, I think that respectively > > error("%s: error while creating %s image: %s", filename, fmt, > strerror(-ret); > > error(%s: error while converting to %s: %s", out_filename, fmt, > strerror(-ret); > > would be more consistent with usual error messages: > > $ cat fdsfds > cat: fdsfds: No such file or directory I agree. I just didn't want to change it too much. > Paolo