Re: [Qemu-devel] [PATCH 5/5] qtest: Document calling conventions

2017-07-21 Thread Markus Armbruster
Eric Blake writes: > On 07/21/2017 01:42 AM, Markus Armbruster wrote: >>> But with json-lexer style, %s MODIFIES its input. >> >> Your assertion "MODIFIES its input" confused me briefly, because I read >> it as "side effect on the argument string". That would be bonkers. >> What you mean is it

Re: [Qemu-devel] [PATCH 5/5] qtest: Document calling conventions

2017-07-21 Thread Eric Blake
On 07/21/2017 01:42 AM, Markus Armbruster wrote: >> But with json-lexer style, %s MODIFIES its input. > > Your assertion "MODIFIES its input" confused me briefly, because I read > it as "side effect on the argument string". That would be bonkers. > What you mean is it doesn't emit the argument st

Re: [Qemu-devel] [PATCH 5/5] qtest: Document calling conventions

2017-07-20 Thread Markus Armbruster
Eric Blake writes: > On 07/20/2017 03:37 PM, Eric Blake wrote: + * @fmt...: QMP message to send to qemu; only recognizes formats + * understood by json-lexer.c * * Sends a QMP message to QEMU and consumes the response. */ >>> >>> These formats are chosen so that gcc

Re: [Qemu-devel] [PATCH 5/5] qtest: Document calling conventions

2017-07-20 Thread Eric Blake
On 07/20/2017 03:37 PM, Eric Blake wrote: >>> + * @fmt...: QMP message to send to qemu; only recognizes formats >>> + * understood by json-lexer.c >>> * >>> * Sends a QMP message to QEMU and consumes the response. >>> */ >> >> These formats are chosen so that gcc can help us check them. Plea

Re: [Qemu-devel] [PATCH 5/5] qtest: Document calling conventions

2017-07-20 Thread Eric Blake
On 07/20/2017 05:10 AM, Markus Armbruster wrote: > Eric Blake writes: > >> 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. Since qmp() only accepts >> a subset of printf fla

Re: [Qemu-devel] [PATCH 5/5] qtest: Document calling conventions

2017-07-20 Thread Markus Armbruster
Eric Blake writes: > 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. Since qmp() only accepts > a subset of printf flags (namely, those that our JSON parser > understands), I

[Qemu-devel] [PATCH 5/5] qtest: Document calling conventions

2017-07-14 Thread Eric Blake
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. Since qmp() only accepts a subset of printf flags (namely, those that our JSON parser understands), I figured that it is probably not