[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors |
Date: |
Thu, 31 May 2012 17:07:59 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
Am 31.05.2012 16:06, schrieb Luiz Capitulino:
> On Thu, 31 May 2012 12:42:34 +0200
> Paolo Bonzini <address@hidden> wrote:
>> Errors are not QAPI-ized yet, so we can add errno values to the above
>> five errors too.
>
> We've preferred adding new errors instead of adding errno values to
> existing errors. I don't remember exactly why, but I personally don't care.
The problem is that you really need more information. You have at least
the information _what_ went wrong ("could not open image"), and usually
also _why_ it went wrong ("permission denied"). You may want to add even
more fields, but this is the minimum.
You cannot represent both in a single error code. Either you have a
FileOpenFailed error that has an errno field for the reason, or you have
a PermissionDenied error that has some field that tells us that opening
the file has failed (and probably the name of the file).
What Anthony has been suggesting so far is the PermissionDenied error
without any additional information. And that is not enough, especially
when you consider a QMP command like 'transaction' that modifies
multiple files at once.
Kevin
- [Qemu-devel] [PATCH 02/14] qerror: add new errors, (continued)
- [Qemu-devel] [PATCH 02/14] qerror: add new errors, Luiz Capitulino, 2012/05/30
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Paolo Bonzini, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Luiz Capitulino, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Paolo Bonzini, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Luiz Capitulino, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Paolo Bonzini, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Luiz Capitulino, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Paolo Bonzini, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Luiz Capitulino, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors, Paolo Bonzini, 2012/05/31
- Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors,
Kevin Wolf <=
[Qemu-devel] [PATCH 07/14] omap_lcdc: rename ppm_save() to omap_ppm_save(), Luiz Capitulino, 2012/05/30
[Qemu-devel] [PATCH 10/14] omap_lcdc: omap_ppm_save(): add error handling, Luiz Capitulino, 2012/05/30
[Qemu-devel] [PATCH 12/14] tcx: tcx24_screen_dump(): add error handling, Luiz Capitulino, 2012/05/30
[Qemu-devel] [PATCH 13/14] tcx: tcx_screen_dump(): add error handling, Luiz Capitulino, 2012/05/30
[Qemu-devel] [PATCH 14/14] qapi: convert screendump, Luiz Capitulino, 2012/05/30
[Qemu-devel] [PATCH 01/14] qerror: extend QERR_TOO_MANY_FILES, Luiz Capitulino, 2012/05/30
[Qemu-devel] [PATCH 09/14] vga: ppm_save(): add error handling, Luiz Capitulino, 2012/05/30
[Qemu-devel] [PATCH 06/14] cutils: introduce qemu_fwrite_err(), Luiz Capitulino, 2012/05/30