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: Luiz Capitulino
Subject: Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors
Date: Thu, 31 May 2012 11:31:27 -0300

On Thu, 31 May 2012 16:25:48 +0200
Paolo Bonzini <address@hidden> wrote:

> 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.

Ah, that's ok. But the client can do it already. Of course it has not know
how we're mapping errno to strings, because we don't have "EINVAL" as a
error name we have "InvalidArgument".

> >> 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. :)

We already did, changing this now will probably be worse.



reply via email to

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