Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-17 Thread Fam Zheng
On Sat, 02/15 11:01, Markus Armbruster wrote: Jeff Cody jc...@redhat.com writes: On Fri, Feb 14, 2014 at 05:45:40PM +0100, Kevin Wolf wrote: Am 11.02.2014 um 18:03 hat Paolo Bonzini geschrieben: Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/cow.c | 12 +++-

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-17 Thread Paolo Bonzini
Il 17/02/2014 14:15, Fam Zheng ha scritto: Does this mean that error_is_set() is always used by programmer to check a non-NULL error pointer? Is there any case to call error_is_set(errp) without knowing if errp is NULL or not? If no, should we enforce the rule and add assert(errp) in

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-17 Thread Jeff Cody
On Mon, Feb 17, 2014 at 02:20:10PM +0100, Paolo Bonzini wrote: Il 17/02/2014 14:15, Fam Zheng ha scritto: Does this mean that error_is_set() is always used by programmer to check a non-NULL error pointer? Is there any case to call error_is_set(errp) without knowing if errp is NULL or not? If

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-17 Thread Kevin Wolf
Am 17.02.2014 um 14:15 hat Fam Zheng geschrieben: On Sat, 02/15 11:01, Markus Armbruster wrote: Jeff Cody jc...@redhat.com writes: On Fri, Feb 14, 2014 at 05:45:40PM +0100, Kevin Wolf wrote: Am 11.02.2014 um 18:03 hat Paolo Bonzini geschrieben: Signed-off-by: Paolo Bonzini

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-17 Thread Markus Armbruster
Fam Zheng f...@redhat.com writes: On Sat, 02/15 11:01, Markus Armbruster wrote: Jeff Cody jc...@redhat.com writes: On Fri, Feb 14, 2014 at 05:45:40PM +0100, Kevin Wolf wrote: Am 11.02.2014 um 18:03 hat Paolo Bonzini geschrieben: Signed-off-by: Paolo Bonzini pbonz...@redhat.com ---

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-17 Thread Fam Zheng
On Mon, 02/17 14:20, Paolo Bonzini wrote: Il 17/02/2014 14:15, Fam Zheng ha scritto: Does this mean that error_is_set() is always used by programmer to check a non-NULL error pointer? Is there any case to call error_is_set(errp) without knowing if errp is NULL or not? If no, should we enforce

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-17 Thread Fam Zheng
On Mon, 02/17 15:59, Markus Armbruster wrote: Fam Zheng f...@redhat.com writes: On Sat, 02/15 11:01, Markus Armbruster wrote: Does this mean that error_is_set() is always used by programmer to check a non-NULL error pointer? Is there any case to call error_is_set(errp) without knowing if

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-15 Thread Markus Armbruster
Jeff Cody jc...@redhat.com writes: On Fri, Feb 14, 2014 at 05:45:40PM +0100, Kevin Wolf wrote: Am 11.02.2014 um 18:03 hat Paolo Bonzini geschrieben: Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/cow.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-)

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-14 Thread Kevin Wolf
Am 11.02.2014 um 18:03 hat Paolo Bonzini geschrieben: Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/cow.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/block/cow.c b/block/cow.c index 7fc0b12..43a2150 100644 --- a/block/cow.c +++

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-14 Thread Jeff Cody
On Fri, Feb 14, 2014 at 05:45:40PM +0100, Kevin Wolf wrote: Am 11.02.2014 um 18:03 hat Paolo Bonzini geschrieben: Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/cow.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/block/cow.c

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-14 Thread Paolo Bonzini
Il 14/02/2014 17:45, Kevin Wolf ha scritto: -ret = bdrv_file_open(cow_bs, filename, NULL, NULL, BDRV_O_RDWR, - local_err); +ret = bdrv_file_open(cow_bs, filename, NULL, NULL, BDRV_O_RDWR, errp); if (ret 0) { -qerror_report_err(local_err); -

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-14 Thread Kevin Wolf
Am 14.02.2014 um 18:02 hat Paolo Bonzini geschrieben: Il 14/02/2014 17:45, Kevin Wolf ha scritto: -ret = bdrv_file_open(cow_bs, filename, NULL, NULL, BDRV_O_RDWR, - local_err); +ret = bdrv_file_open(cow_bs, filename, NULL, NULL, BDRV_O_RDWR, errp);

Re: [Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-14 Thread Paolo Bonzini
Il 14/02/2014 19:19, Kevin Wolf ha scritto: Eventually this function will return void; having both a -errno return and the errp argument is just an intermediate step (as probably in all other cases). So I still think this is going in the wrong direction and will make the conversion harder than

[Qemu-devel] [PATCH v2 09/20] cow: correctly propagate errors

2014-02-11 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/cow.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/block/cow.c b/block/cow.c index 7fc0b12..43a2150 100644 --- a/block/cow.c +++ b/block/cow.c @@ -82,7 +82,7 @@ static int cow_open(BlockDriverState *bs,