From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxanU-0002Nn-K0 for qemu-devel@nongnu.org; Wed, 15 Feb 2012 04:05:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxanK-0001lz-JP for qemu-devel@nongnu.org; Wed, 15 Feb 2012 04:05:08 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:44795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxanK-0001lt-Cs for qemu-devel@nongnu.org; Wed, 15 Feb 2012 04:04:58 -0500 Received: by pbbro12 with SMTP id ro12so1442455pbb.4 for ; Wed, 15 Feb 2012 01:04:57 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F3B7532.6050902@redhat.com> Date: Wed, 15 Feb 2012 10:04:50 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1328902266-25308-1-git-send-email-lcapitulino@redhat.com> <1328902266-25308-5-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1328902266-25308-5-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/6] Error: Introduce error_copy() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, quintela@redhat.com 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