[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v3 09/12] tests/libqos/pci: Clean u
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v3 09/12] tests/libqos/pci: Clean up string interpolation into QMP input |
Date: |
Fri, 28 Jul 2017 19:42:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Stefan Hajnoczi <address@hidden> writes:
> On Tue, Jul 25, 2017 at 04:15:20PM -0500, Eric Blake wrote:
>> @@ -419,19 +420,18 @@ static void test_ivshmem_server_irq(void)
>> static void test_ivshmem_hotplug(void)
>> {
>> const char *arch = qtest_get_arch();
>> - gchar *opts;
>> + QObject *extra_args = qobject_from_jsonf("{ 'shm': '%s', 'size': '1M'
>> }",
>> + tmpshm);
>
> Is there a difference between:
>
> qobject_from_jsonf("{ 'shm': '%s' }", tmpshm);
>
> and:
>
> qobject_from_jsonf("{ 'shm': %s }", tmpshm);
>
> ?
>
> Below you use %s instead of '%s'.
Yes. %s interpolates a JSON string, enclosed in quotes, funny
characters quoted. Thus, the former is wrong. I screwed up the
conversion from g_strdup_printf(). Good catch!