[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 04/22] qapi: extend qdict_flatten() for QList
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 04/22] qapi: extend qdict_flatten() for QLists |
Date: |
Fri, 13 Dec 2013 13:04:47 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
On 12/13/2013 10:10 AM, Max Reitz wrote:
> Reversing qdict_array_split(), qdict_flatten() should flatten QLists as
> well by interpreting them as QDicts where every entry's key is its
> index.
>
> This allows bringing QDicts with QLists from QMP commands to the same
> form as they would be given as command-line options, thereby allowing
> them to be parsed the same way.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> qobject/qdict.c | 58
> +++++++++++++++++++++++++++++++++++++++++++++++++++------
> + /* This function is never called with prefix == NULL, i.e., it is always
> + * called from within qdict_flatten_q(list|dict)(). Therefore, it does
> not
> + * need to remove list entries during the iteration (the whole list will
> be
> + * deleted eventually anyway from qdict_flatten_qdict()). Also, prefix
> can
> + * never be NULL. */
The comment sounds redundant: "never called with prefix == NULL ...
prefix can never be NULL".
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v5 01/22] blkdebug: Use errp for read_config(), (continued)
- [Qemu-devel] [PATCH v5 02/22] blkdebug: Don't require sophisticated filename, Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 03/22] qdict: Add qdict_array_split(), Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 05/22] qdict: Remove delete from qdict_flatten_qdict(), Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 06/22] qemu-option: Add qemu_config_parse_qdict(), Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 04/22] qapi: extend qdict_flatten() for QLists, Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 07/22] blkdebug: Always call read_config(), Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 08/22] blkdebug: Use command-line in read_config(), Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 09/22] block: Allow reference for bdrv_file_open(), Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 10/22] block: Pass reference to bdrv_file_open(), Max Reitz, 2013/12/13
- [Qemu-devel] [PATCH v5 11/22] block: Allow block devices without files, Max Reitz, 2013/12/13