Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-10 Thread Anthony Liguori
On 02/08/2010 01:01 PM, Luiz Capitulino wrote: Add an assert() to qobject_from_jsonf() to assure that the returned QObject is not NULL. Currently this is duplicated in the callers. Signed-off-by: Luiz Capitulino Applied all. Thanks. Regards, Anthony Liguori --- qjson.c |5 +

[Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-08 Thread Luiz Capitulino
Add an assert() to qobject_from_jsonf() to assure that the returned QObject is not NULL. Currently this is duplicated in the callers. Signed-off-by: Luiz Capitulino --- qjson.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/qjson.c b/qjson.c index 9ad8a91..483c667 1

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-08 Thread Luiz Capitulino
On Mon, 08 Feb 2010 08:53:26 -0600 Anthony Liguori wrote: > On 02/05/2010 11:14 AM, Markus Armbruster wrote: > >> Run time asserts are a terrible way to deal with reasonably expected > >> errors. > >> > > Yes. But what's reasonably expected entirely depends on the contract > > between the

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-08 Thread Anthony Liguori
On 02/05/2010 11:14 AM, Markus Armbruster wrote: Run time asserts are a terrible way to deal with reasonably expected errors. Yes. But what's reasonably expected entirely depends on the contract between the function and its callers. I think we need a function that cannot fail and shouldn

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-08 Thread Luiz Capitulino
On Fri, 05 Feb 2010 18:14:41 +0100 Markus Armbruster wrote: > Anthony Liguori writes: [...] > Yes. But what's reasonably expected entirely depends on the contract > between the function and its callers. > > I think we need a function that cannot fail and shouldn't used with > untrusted argum

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-05 Thread Markus Armbruster
Anthony Liguori writes: > On 02/05/2010 06:12 AM, Luiz Capitulino wrote: >> On Thu, 04 Feb 2010 16:31:46 -0600 >> Anthony Liguori wrote: >> >> >>> On 02/04/2010 02:13 PM, Luiz Capitulino wrote: >>> Add an assert() to qobject_from_jsonf() to assure that the returned QObject is

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-05 Thread Anthony Liguori
On 02/05/2010 06:12 AM, Luiz Capitulino wrote: On Thu, 04 Feb 2010 16:31:46 -0600 Anthony Liguori wrote: On 02/04/2010 02:13 PM, Luiz Capitulino wrote: Add an assert() to qobject_from_jsonf() to assure that the returned QObject is not NULL. Currently this is duplicated in the caller

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-05 Thread Luiz Capitulino
On Fri, 05 Feb 2010 10:13:33 +0100 Markus Armbruster wrote: > Anthony Liguori writes: > > > On 02/04/2010 02:13 PM, Luiz Capitulino wrote: > >> Add an assert() to qobject_from_jsonf() to assure that the returned > >> QObject is not NULL. Currently this is duplicated in the callers. > >> > >> Si

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-05 Thread Luiz Capitulino
On Thu, 04 Feb 2010 16:31:46 -0600 Anthony Liguori wrote: > On 02/04/2010 02:13 PM, Luiz Capitulino wrote: > > Add an assert() to qobject_from_jsonf() to assure that the returned > > QObject is not NULL. Currently this is duplicated in the callers. > > > > Signed-off-by: Luiz Capitulino > > --- >

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-05 Thread Markus Armbruster
Anthony Liguori writes: > On 02/04/2010 02:13 PM, Luiz Capitulino wrote: >> Add an assert() to qobject_from_jsonf() to assure that the returned >> QObject is not NULL. Currently this is duplicated in the callers. >> >> Signed-off-by: Luiz Capitulino >> --- >> qjson.c |1 + >> 1 files chang

Re: [Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-04 Thread Anthony Liguori
On 02/04/2010 02:13 PM, Luiz Capitulino wrote: Add an assert() to qobject_from_jsonf() to assure that the returned QObject is not NULL. Currently this is duplicated in the callers. Signed-off-by: Luiz Capitulino --- qjson.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --gi

[Qemu-devel] [PATCH 1/4] qjson: Improve debugging

2010-02-04 Thread Luiz Capitulino
Add an assert() to qobject_from_jsonf() to assure that the returned QObject is not NULL. Currently this is duplicated in the callers. Signed-off-by: Luiz Capitulino --- qjson.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qjson.c b/qjson.c index 9ad8a91..0922c06 10064