[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/9] qtest: Document calling conventions
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 2/9] qtest: Document calling conventions |
Date: |
Fri, 21 Jul 2017 17:48:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 07/21/2017 08:53 AM, Markus Armbruster wrote:
>> From: Eric Blake <address@hidden>
>>
>> We have two flavors of vararg usage in qtest; make it clear that
>> qmp() has different semantics than hmp(), and let the compiler
>> enforce that hmp() is used correctly. However, qmp() (and friends)
>> only accept a subset of printf flags look-alikes (namely, those
>> that our JSON parser understands), and what is worse, qmp("true")
>> (the JSON keyword 'true') is different from qmp("%s", "true")
>> (the JSON string '"true"'), so marking those as printf-like would
>> produce more harm from bogus warnings than it helps (we may have
>> made a mistake in previously marking qobject_from_jsonf(), but
>> this patch is not addressing that).
>>
>> Signed-off-by: Eric Blake <address@hidden>
>> Message-Id: <address@hidden>
>> Signed-off-by: Markus Armbruster <address@hidden>
>
> As you pointed out on the other thread,
>
>> @@ -134,7 +137,7 @@ QDict *qtest_qmp_eventwait_ref(QTestState *s, const char
>> *event);
>> /**
>> * qtest_hmp:
>> * @s: #QTestState instance to operate on.
>> - * @fmt...: HMP command to send to QEMU
>> + * @fmt...: HMP command to send to QEMU, formats arguments like vsprintf().
>> *
>> * Send HMP command to QEMU via QMP's human-monitor-command.
>> * QMP events are discarded.
>
> I accidentally killed the attribute here,
>
>> @@ -592,7 +598,7 @@ static inline QDict *qmp_eventwait_ref(const char *event)
>>
>> /**
>> * hmp:
>> - * @fmt...: HMP command to send to QEMU
>> + * @fmt...: HMP command to send to QEMU, formats arguments like vsprintf().
>> *
>> * Send HMP command to QEMU via QMP's human-monitor-command.
>> *
>
> and here.
Putting them back is easier than updating commit message 1/9.
- Re: [Qemu-devel] [PATCH 8/9] tests/libqtest: Clean up how we read the QMP greeting, (continued)
- [Qemu-devel] [PATCH 5/9] tests/libqos/usb: Clean up string interpolation into QMP input, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 7/9] tests: Clean up wait for event, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 2/9] qtest: Document calling conventions, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 6/9] tests/libqos/pci: Clean up string interpolation into QMP input, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 9/9] tests/libqtest: Enable compile-time format string checking, Markus Armbruster, 2017/07/21