[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: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors
Date: Thu, 31 May 2012 17:07:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

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


reply via email to

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