[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 10/10] block: print errno on error
From: |
Juan Quintela |
Subject: |
[Qemu-devel] Re: [PATCH 10/10] block: print errno on error |
Date: |
Wed, 03 Mar 2010 17:21:00 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Paolo Bonzini <address@hidden> 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
- [Qemu-devel] [PATCH 05/10] vmdk: return errno instead of -1, (continued)
- [Qemu-devel] [PATCH 05/10] vmdk: return errno instead of -1, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 06/10] vl: exit if we are not able to write into the pipe, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 07/10] vmdk: make vmdk_snapshot_create return -errno, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 08/10] vmdk: fix double free, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 09/10] vmdk: share cleanup code, Juan Quintela, 2010/03/03
- [Qemu-devel] [PATCH 10/10] block: print errno on error, Juan Quintela, 2010/03/03