[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 21/22] libqtest: Drop now-unused qmp()
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 21/22] libqtest: Drop now-unused qmp() |
Date: |
Wed, 9 Aug 2017 11:43:24 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 08/09/2017 11:01 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> All callers have been converted to a form of qmp_cmd() or
>> qmp_args() that takes the command name with less boilerplate.
>> Therefore, we also know that all commands are using
>> interpolation, and can remove an assertion.
>>
>> This also means that we have fixed the testsuite to comply with
>> -Wformat checking on the strings being interpolated for qmp()
>> (similar to what we previously did for strings used in hmp(), and
>> matching the checking present on qobject_from_jsonf()).
>>
>> Signed-off-by: Eric Blake <address@hidden>
>> ---
>> - * A round trip through QObject is only needed if % interpolation
>> - * is used. We interpolate through QObject rather than sprintf in
>> - * order to escape strings properly.
>> + * A round trip through QObject (and not sprintf) is needed
>> + * because % interpolation is used, and we must escape strings
>> + * properly.
>> */
>> - if (!strchr(fmt, '%')) {
>> - qmp_fd_send(s->qmp_fd, fmt);
>> - return;
>> - }
>> + assert(strchr(fmt, '%'));
>
> What exactly is wrong with a @fmt that doesn't contain '%'?
Nothing, so much as proving to myself that I indeed converted all the
qmp() calls. As before, the assertion is not vital to the series, and
can be omitted on the respin.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v4 14/22] libqtest: Separate qmp_discard_response() from command, (continued)
[Qemu-devel] [PATCH v4 18/22] tests/libqos/usb: Clean up string interpolation into QMP input, Eric Blake, 2017/08/03
[Qemu-devel] [PATCH v4 19/22] libqtest: Add qmp_args_dict() helper, Eric Blake, 2017/08/03
[Qemu-devel] [PATCH v4 21/22] libqtest: Drop now-unused qmp(), Eric Blake, 2017/08/03
[Qemu-devel] [PATCH v4 16/22] libqtest: Add qmp_cmd() helper, Eric Blake, 2017/08/03
[Qemu-devel] [PATCH v4 17/22] libqtest: Add qmp_args() helper, Eric Blake, 2017/08/03
[Qemu-devel] [PATCH v4 20/22] tests/libqos/pci: Clean up string interpolation into QMP input, Eric Blake, 2017/08/03
[Qemu-devel] [PATCH v4 22/22] libqtest: Rename qmp_cmd() to qmp(), Eric Blake, 2017/08/03
Re: [Qemu-devel] [PATCH v4 00/22] Clean up around qmp() and hmp(), no-reply, 2017/08/03