From: Max Reitz <mreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: pkrempa@redhat.com, eblake@redhat.com, jcody@redhat.com,
jdurgin@redhat.com, mitake.hitoshi@lab.ntt.co.jp,
namei.unix@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 11/36] qdict: Introduce qdict_rename_keys()
Date: Thu, 22 Feb 2018 23:40:20 +0100 [thread overview]
Message-ID: <a298c2cb-f2d9-afef-ea2f-587378ba37a9@redhat.com> (raw)
In-Reply-To: <20180221135404.27598-12-kwolf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]
On 2018-02-21 14:53, Kevin Wolf wrote:
> A few block drivers will need to rename .bdrv_create options for their
> QAPIfication, so let's have a helper function for that.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> include/qapi/qmp/qdict.h | 6 +++
> qobject/qdict.c | 34 ++++++++++++++
> tests/check-qdict.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 153 insertions(+)
[...]
> diff --git a/tests/check-qdict.c b/tests/check-qdict.c
> index ec628f3453..5f8f3be9ff 100644
> --- a/tests/check-qdict.c
> +++ b/tests/check-qdict.c
> @@ -665,6 +665,117 @@ static void qdict_crumple_test_empty(void)
[...]
> + /* Renames are processed top to bottom */
> + renames = (QDictRenames[]) {
> + { "abc", "tmp" },
> + { "abcdef", "abc" },
> + { "number", "abcdef" },
> + { "flag", "number" },
> + { "nothing", "flag" },
> + { "tmp", "nothing" },
> + { NULL , NULL }
> + };
A bit confusing to follow, but I guess nobody will have to follow it
after me and Eric.
> + copy = qdict_clone_shallow(dict);
> + qdict_rename_keys(copy, renames, &error_abort);
> +
> + g_assert_cmpstr(qdict_get_str(copy, "nothing"), ==, "foo");
> + g_assert_cmpstr(qdict_get_str(copy, "abc"), ==, "bar");
> + g_assert_cmpint(qdict_get_int(copy, "abcdef"), ==, 42);
> + g_assert_cmpint(qdict_get_bool(copy, "number"), ==, true);
> + g_assert(qobject_type(qdict_get(copy, "flag")) == QTYPE_QNULL);
> + g_assert(!qdict_haskey(copy, "tmp"));
> +
> + QDECREF(copy);
> +
> + /* Conflicting renam */
*rename
With that fixed:
Reviewed-by: Max Reitz <mreitz@redhat.com>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
next prev parent reply other threads:[~2018-02-22 22:40 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 13:53 [Qemu-devel] [PATCH v2 00/36] x-blockdev-create for protocols and qcow2 Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 01/36] block/qapi: Introduce BlockdevCreateOptions Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 02/36] block/qapi: Add qcow2 create options to schema Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 03/36] qcow2: Let qcow2_create() handle protocol layer Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 04/36] qcow2: Pass BlockdevCreateOptions to qcow2_create2() Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 05/36] qcow2: Use BlockdevRef in qcow2_create2() Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 06/36] qcow2: Use QCryptoBlockCreateOptions " Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 07/36] qcow2: Handle full/falloc preallocation " Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 08/36] util: Add qemu_opts_to_qdict_filtered() Kevin Wolf
2018-02-21 20:38 ` Eric Blake
2018-02-22 22:03 ` Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 09/36] test-qemu-opts: Test qemu_opts_append() Kevin Wolf
2018-02-21 20:53 ` Eric Blake
2018-02-22 22:19 ` Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 10/36] test-qemu-opts: Test qemu_opts_to_qdict_filtered() Kevin Wolf
2018-02-21 20:57 ` Eric Blake
2018-02-22 9:50 ` Kevin Wolf
2018-02-22 14:24 ` Eric Blake
2018-02-22 22:26 ` Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 11/36] qdict: Introduce qdict_rename_keys() Kevin Wolf
2018-02-22 22:40 ` Max Reitz [this message]
2018-02-22 23:13 ` Eric Blake
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 12/36] qcow2: Use visitor for options in qcow2_create() Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 13/36] block: Make bdrv_is_whitelisted() public Kevin Wolf
2018-02-22 22:45 ` Max Reitz
2018-02-22 23:17 ` Eric Blake
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 14/36] block: x-blockdev-create QMP command Kevin Wolf
2018-02-22 22:50 ` Max Reitz
2018-02-22 23:19 ` Eric Blake
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 15/36] file-posix: Support .bdrv_co_create Kevin Wolf
2018-02-22 23:34 ` Eric Blake
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 16/36] file-win32: " Kevin Wolf
2018-02-23 14:46 ` Eric Blake
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 17/36] gluster: " Kevin Wolf
2018-02-22 23:01 ` Max Reitz
2018-02-23 15:10 ` Eric Blake
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 18/36] rbd: Fix use after free in qemu_rbd_set_keypairs() error path Kevin Wolf
2018-02-22 23:02 ` Max Reitz
2018-02-23 15:15 ` Eric Blake
2018-02-23 15:56 ` Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 19/36] rbd: Factor out qemu_rbd_connect() Kevin Wolf
2018-02-22 23:10 ` Max Reitz
2018-02-23 15:19 ` Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 20/36] rbd: Remove non-schema options from runtime_opts Kevin Wolf
2018-02-22 23:13 ` Max Reitz
2018-02-22 23:16 ` Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 21/36] rbd: Pass BlockdevOptionsRbd to qemu_rbd_connect() Kevin Wolf
2018-02-22 23:25 ` Max Reitz
2018-02-23 16:19 ` Kevin Wolf
2018-02-23 16:43 ` Max Reitz
2018-02-23 17:09 ` Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 22/36] rbd: Support .bdrv_co_create Kevin Wolf
2018-02-22 23:30 ` Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 23/36] rbd: Assing s->snap/image_name in qemu_rbd_open() Kevin Wolf
2018-02-22 23:34 ` [Qemu-devel] [PATCH v2 23/36] rbd: ***ing " Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 24/36] rbd: Use qemu_rbd_connect() in qemu_rbd_do_create() Kevin Wolf
2018-02-22 23:37 ` Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 25/36] nfs: Use QAPI options in nfs_client_open() Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 26/36] nfs: Support .bdrv_co_create Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 27/36] sheepdog: QAPIfy "redundacy" create option Kevin Wolf
2018-02-22 23:43 ` Max Reitz
2018-02-23 15:25 ` Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 28/36] sheepdog: Support .bdrv_co_create Kevin Wolf
2018-02-22 23:51 ` Max Reitz
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 29/36] ssh: Use QAPI BlockdevOptionsSsh object Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 30/36] ssh: QAPIfy host-key-check option Kevin Wolf
2018-02-21 13:53 ` [Qemu-devel] [PATCH v2 31/36] ssh: Pass BlockdevOptionsSsh to connect_to_ssh() Kevin Wolf
2018-02-21 13:54 ` [Qemu-devel] [PATCH v2 32/36] ssh: Support .bdrv_co_create Kevin Wolf
2018-02-26 12:40 ` Max Reitz
2018-02-26 12:40 ` Max Reitz
2018-02-21 13:54 ` [Qemu-devel] [PATCH v2 33/36] file-posix: Fix no-op bdrv_truncate() with falloc preallocation Kevin Wolf
2018-02-23 15:21 ` Eric Blake
2018-02-21 13:54 ` [Qemu-devel] [PATCH v2 34/36] block: Fail bdrv_truncate() with negative size Kevin Wolf
2018-02-22 23:35 ` Eric Blake
2018-02-21 13:54 ` [Qemu-devel] [PATCH v2 35/36] qemu-iotests: Test qcow2 over file image creation with QMP Kevin Wolf
2018-02-21 13:54 ` [Qemu-devel] [PATCH v2 36/36] qemu-iotests: Test ssh image creation over QMP Kevin Wolf
2018-02-26 12:53 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a298c2cb-f2d9-afef-ea2f-587378ba37a9@redhat.com \
--to=mreitz@redhat.com \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=jdurgin@redhat.com \
--cc=kwolf@redhat.com \
--cc=mitake.hitoshi@lab.ntt.co.jp \
--cc=namei.unix@gmail.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).