[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors |
Date: |
Thu, 31 May 2012 16:25:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
Il 31/05/2012 16:06, Luiz Capitulino ha scritto:
>> What about errno values? Let's add an enum QemuErrno and convert host
>> errnos to that enum. Enums are sent as strings, so they are neutral to
>> the OS of the host and client. And the client (if it desires) can
>> convert back to an errno value and use strerror to provide a
>> human-readable, easily internationalizable error message.
>
> That's more or less what this patch does and the path we're taking with
> qerror. For errors that have an errno correspondent we're adding classes
> with errno names and this can be converted to an enum or whatever you wish.
>
> Now, using strerror() as a human description has been debated a lot in the
> past and has been declined (mostly by Anthony). I'm in favor of it, but I'm
> afraid I'm not the one to be convinced.
QEMU should not use strerror(), I agree with Anthony on this one. But
if the client wants to convert QMP errno values to host errno values and
use strerror() on those, why not.
>> 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.
Then let's not do it anymore. :)
Paolo
- [Qemu-devel] [PATCH qmp-next v2 00/14]: qapi: convert screendump, Luiz Capitulino, 2012/05/30
- [Qemu-devel] [PATCH 04/14] cutils: introduce qemu_fprintf_err(), Luiz Capitulino, 2012/05/30
- [Qemu-devel] [PATCH 03/14] cutils: introduce qemu_fopen_err(), Luiz Capitulino, 2012/05/30
- [Qemu-devel] [PATCH 08/14] console: vga_hw_screen_dump_ptr: take an Error argument, Luiz Capitulino, 2012/05/30
- [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 <=
- 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, 2012/05/31
[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