Re: [Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-07-16 Thread Luiz Capitulino
On Mon, 16 Jul 2012 22:31:26 +0200 Laszlo Ersek wrote: > On 07/16/12 19:12, Luiz Capitulino wrote: > > On Fri, 13 Jul 2012 21:11:15 +0200 > > Paolo Bonzini wrote: > > > > >> I think doing it for error_set was just for symmetry and to avoid > >> introducing excessive complexity. > > > > We alr

Re: [Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-07-16 Thread Laszlo Ersek
On 07/16/12 19:12, Luiz Capitulino wrote: > On Fri, 13 Jul 2012 21:11:15 +0200 > Paolo Bonzini wrote: > >> I think doing it for error_set was just for symmetry and to avoid >> introducing excessive complexity. > > We already check if the error is set in several places, and I don't think > it wi

Re: [Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-07-16 Thread Luiz Capitulino
On Fri, 13 Jul 2012 21:11:15 +0200 Paolo Bonzini wrote: > Il 13/07/2012 19:30, Laszlo Ersek ha scritto: > >>> >> -if (errp == NULL) { > >>> >> +if (errp == NULL || *errp != NULL) { > >> > > >> > I think we should use assert() here. > >> > > >> > If the error is already set, that most pr

Re: [Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-07-13 Thread Laszlo Ersek
On 07/13/12 21:11, Paolo Bonzini wrote: > Il 13/07/2012 19:30, Laszlo Ersek ha scritto: >> -if (errp == NULL) { >> +if (errp == NULL || *errp != NULL) { I think we should use assert() here. If the error is already set, that most probably indicates a bug in the >

Re: [Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-07-13 Thread Paolo Bonzini
Il 13/07/2012 19:30, Laszlo Ersek ha scritto: >>> >> -if (errp == NULL) { >>> >> +if (errp == NULL || *errp != NULL) { >> > >> > I think we should use assert() here. >> > >> > If the error is already set, that most probably indicates a bug in the >> > caller, as >> > it's the caller's re

Re: [Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-07-13 Thread Laszlo Ersek
On 07/13/12 18:38, Luiz Capitulino wrote: > On Wed, 13 Jun 2012 10:22:32 +0200 > Laszlo Ersek wrote: > >> From: Paolo Bonzini >> >> Don't overwrite / leak previously set errors. > > Can you elaborate a bit more? It's not clear to me where the bug is. Suppose you encounter the first error on th

Re: [Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-07-13 Thread Luiz Capitulino
On Wed, 13 Jun 2012 10:22:32 +0200 Laszlo Ersek wrote: > From: Paolo Bonzini > > Don't overwrite / leak previously set errors. Can you elaborate a bit more? It's not clear to me where the bug is. More comments below. > Don't try to end a container that could not be started. > > Signed-off-b

[Qemu-devel] [PATCH v2 01/17] qapi: fix error propagation

2012-06-13 Thread Laszlo Ersek
From: Paolo Bonzini Don't overwrite / leak previously set errors. Don't try to end a container that could not be started. Signed-off-by: Paolo Bonzini Signed-off-by: Laszlo Ersek --- error.h|4 +- error.c|4 +- qapi/qapi-visit-core.c