[Top][All Lists]
[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).
- [Qemu-devel] [PATCH 0/6] qapi: Convert migrate, Luiz Capitulino, 2012/02/10
- [Qemu-devel] [PATCH 1/6] QError: Introduce new errors for the migration command, Luiz Capitulino, 2012/02/10
- [Qemu-devel] [PATCH 2/6] monitor: Introduce qemu_get_fd(), Luiz Capitulino, 2012/02/10
- [Qemu-devel] [PATCH 3/6] QDict: Introduce qdict_copy(), Luiz Capitulino, 2012/02/10
- [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy(), Luiz Capitulino, 2012/02/10
- Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy(), Juan Quintela, 2012/02/15
- [Qemu-devel] [PATCH 5/6] Purge migration of (almost) everything to do with monitors, Luiz Capitulino, 2012/02/10
- Re: [Qemu-devel] [PATCH 5/6] Purge migration of (almost) everything to do with monitors, Juan Quintela, 2012/02/15
[Qemu-devel] [PATCH 6/6] qapi: Convert migrate, Luiz Capitulino, 2012/02/10