qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]