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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy()
Date: Wed, 15 Feb 2012 10:04:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0

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 once they've
been built.  (Also, I would refcount Errors rather than copy them, but
that's a personal preference and I do not really object to error_copy).

Paolo



reply via email to

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