From: Paolo Bonzini <pbonzini@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: amit.shah@redhat.com, qemu-devel@nongnu.org,
Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] Re: [PATCH 10/10] block: print errno on error
Date: Wed, 03 Mar 2010 15:36:04 +0100 [thread overview]
Message-ID: <4B8E73D4.4090205@redhat.com> (raw)
In-Reply-To: <4B8E6BB2.7040606@redhat.com>
>> 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.
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
Paolo
next prev parent reply other threads:[~2010-03-03 14:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 12:06 [Qemu-devel] [PATCH 00/10] FORTIFY_SOURCE followup Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 01/10] cow: return errno instead of -1 Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 02/10] slirp: check system() success Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 03/10] qcow2: return errno instead of -1 Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 04/10] qcow: " Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 05/10] vmdk: " Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 06/10] vl: exit if we are not able to write into the pipe Juan Quintela
2010-03-03 13:51 ` [Qemu-devel] " Kevin Wolf
2010-03-03 14:00 ` Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 07/10] vmdk: make vmdk_snapshot_create return -errno Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 08/10] vmdk: fix double free Juan Quintela
2010-03-03 12:06 ` [Qemu-devel] [PATCH 09/10] vmdk: share cleanup code Juan Quintela
2010-03-03 12:07 ` [Qemu-devel] [PATCH 10/10] block: print errno on error Juan Quintela
2010-03-03 14:01 ` [Qemu-devel] " Kevin Wolf
2010-03-03 14:36 ` Paolo Bonzini [this message]
2010-03-03 16:21 ` Juan Quintela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B8E73D4.4090205@redhat.com \
--to=pbonzini@redhat.com \
--cc=amit.shah@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).