[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 09/12] tests/libqos/pci: Clean up string inte
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 09/12] tests/libqos/pci: Clean up string interpolation into QMP input |
Date: |
Fri, 28 Jul 2017 11:35:26 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/28/2017 08:05 AM, Stefan Hajnoczi wrote:
> 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);
Yes, and it's important.
sprintf("{ 'shm': '%s' }", tmpshm);
is the same as
qobject_from_jsonf("{ 'shm': %s }" tmpshm);
Passing '%s' through qobject_from_jsonf() is generally wrong (it would
produce ''...'' instead of the intended '...').
Looks like something to fix on the next round.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 07/12] qtest: Add a new helper qmp_cmd() and friends, (continued)