Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-06-01 Thread Kevin Wolf
Am 31.05.2012 18:08, schrieb Luiz Capitulino: > On Thu, 31 May 2012 17:49:42 +0200 > Paolo Bonzini wrote: > >> Il 31/05/2012 17:44, Luiz Capitulino ha scritto: One is "do not shoehorn errors into errno values". So for QOM invalid values we have PropertyValueBad, not a generic Inv

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 18:08, Luiz Capitulino ha scritto: > On Thu, 31 May 2012 17:49:42 +0200 > Paolo Bonzini wrote: > >> Il 31/05/2012 17:44, Luiz Capitulino ha scritto: One is "do not shoehorn errors into errno values". So for QOM invalid values we have PropertyValueBad, not a generic

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Luiz Capitulino
On Thu, 31 May 2012 17:49:42 +0200 Paolo Bonzini wrote: > Il 31/05/2012 17:44, Luiz Capitulino ha scritto: > >> One is "do not shoehorn errors into errno values". So for QOM invalid > >> values we > >> have PropertyValueBad, not a generic InvalidArgument value. We convert > >> everything > >>

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 17:44, Luiz Capitulino ha scritto: >> One is "do not shoehorn errors into errno values". So for QOM invalid >> values we >> have PropertyValueBad, not a generic InvalidArgument value. We convert >> everything >> to Error rather than returning negative errno values and then returni

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Luiz Capitulino
On Thu, 31 May 2012 16:54:47 +0200 Paolo Bonzini wrote: > Il 31/05/2012 16:31, Luiz Capitulino ha scritto: > 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 > >>> exi

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Kevin Wolf
Am 31.05.2012 16:06, schrieb Luiz Capitulino: > On Thu, 31 May 2012 12:42:34 +0200 > Paolo Bonzini 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

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Paolo Bonzini
Il 31/05/2012 16:31, Luiz Capitulino ha scritto: 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 car

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Luiz Capitulino
On Thu, 31 May 2012 16:25:48 +0200 Paolo Bonzini 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.

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Paolo Bonzini
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 val

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Luiz Capitulino
On Thu, 31 May 2012 12:42:34 +0200 Paolo Bonzini wrote: > Il 30/05/2012 16:14, Luiz Capitulino ha scritto: > > New errors for write() and open() failures. Will be used by the > > next commits. > > Ouch. We have already these errors: > > #define QERR_OPEN_FILE_FAILED \ > "{ 'class': 'OpenFi

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-31 Thread Paolo Bonzini
Il 30/05/2012 16:14, Luiz Capitulino ha scritto: > New errors for write() and open() failures. Will be used by the > next commits. Ouch. We have already these errors: #define QERR_OPEN_FILE_FAILED \ "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }" #define QERR_SOCKET_CONNECT_FAIL

[Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-30 Thread Luiz Capitulino
New errors for write() and open() failures. Will be used by the next commits. Signed-off-by: Luiz Capitulino --- qerror.c | 28 qerror.h | 21 + 2 files changed, 49 insertions(+) diff --git a/qerror.c b/qerror.c index 6c78759..97670a3 100644 ---

[Qemu-devel] [PATCH 02/14] qerror: add new errors

2012-05-25 Thread Luiz Capitulino
New errors for write() and open() failures. Will be used by the next commits. Signed-off-by: Luiz Capitulino --- qerror.c | 24 qerror.h | 18 ++ 2 files changed, 42 insertions(+) diff --git a/qerror.c b/qerror.c index 2c97382..58e4570 100644 --- a/qerro