qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Luiz Capitulino
Subject: Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy()
Date: Wed, 15 Feb 2012 11:05:56 -0200

On Wed, 15 Feb 2012 10:04:50 +0100
Paolo Bonzini <address@hidden> 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 err_new;
> > +}
> 
> Why isn't an incref sufficient?

You know, I'm looking at the code right now and can't answer myself that
question :-) I think what wanted to do was to duplicate the Error object
and just ended up duplicating everything...

>  QDicts should be constant once they've
> been built. 

I think you meant QErrors?

> (Also, I would refcount Errors rather than copy them, but
> that's a personal preference and I do not really object to error_copy).

The Error object doesn't have refcounts and I'd prefer to just duplicate it
for now (instead of adding it).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]