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