Am 31.05.2012 16:06, schrieb Luiz Capitulino: > On Thu, 31 May 2012 12:42:34 +0200 > Paolo Bonzini <pbonz...@redhat.com> 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