Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy()

2012-02-15 Thread Juan Quintela
Luiz Capitulino wrote: > Signed-off-by: Luiz Capitulino Didn't care if we copy/incref the dictionaries as Paolo suggests. Both work for me. Later, Juan.

Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy()

2012-02-15 Thread Paolo Bonzini
On 02/15/2012 02:05 PM, Luiz Capitulino wrote: >> > QDicts should be constant once they've >> > been built. > I think you meant QErrors? I meant QDicts included in Errors. > > (Also, I would refcount Errors rather than copy them, but > > that's a personal preference and I do not really object t

Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy()

2012-02-15 Thread Luiz Capitulino
On Wed, 15 Feb 2012 10:04:50 +0100 Paolo Bonzini wrote: > On 02/10/2012 08:31 PM, Luiz Capitulino wrote: > > +err_new = g_malloc0(sizeof(*err)); > > +err_new->obj = qdict_copy(err->obj); > > +err_new->msg = g_strdup(err->msg); > > +err_new->fmt = err->fmt; > > + > > +return er

Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy()

2012-02-15 Thread Paolo Bonzini
On 02/10/2012 08:31 PM, Luiz Capitulino wrote: > +err_new = g_malloc0(sizeof(*err)); > +err_new->obj = qdict_copy(err->obj); > +err_new->msg = g_strdup(err->msg); > +err_new->fmt = err->fmt; > + > +return err_new; > +} Why isn't an incref sufficient? QDicts should be constant

[Qemu-devel] [PATCH 4/6] Error: Introduce error_copy()

2012-02-10 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- error.c | 12 error.h |5 + 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/error.c b/error.c index 990050f..d85e136 100644 --- a/error.c +++ b/error.c @@ -43,6 +43,18 @@ void error_set(Error **errp, const char *fmt, ...)