qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]