[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/6] QDict: Introduce qdict_copy()
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH 3/6] QDict: Introduce qdict_copy() |
Date: |
Wed, 15 Feb 2012 14:10:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Luiz Capitulino <address@hidden> wrote:
> Signed-off-by: Luiz Capitulino <address@hidden>
> /**
> + * qdict_copy(): Build a new dictionary from an existing one.
> + */
> +QDict *qdict_copy(const QDict *from)
> +{
> + const QDictEntry *ent;
> + QDict *new;
> +
> + new = qdict_new();
> +
> + for (ent = qdict_first(from); ent; ent = qdict_next(from, ent)) {
> + qdict_put_obj(new, qdict_entry_key(ent), qdict_entry_value(ent));
> + qobject_incref(qdict_entry_value(ent));
> + }
Without having any clue about how qobject refcounting works, it looks
suspicious that we first insert an object in a dict, and increase the
ref counter after. Shouldn't we do it the other way around?
Later, Juan.
- [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
- Re: [Qemu-devel] [PATCH 3/6] QDict: Introduce qdict_copy(),
Juan Quintela <=
- [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