On 08/09/2017 10:40 AM, Markus Armbruster wrote: > Eric Blake <ebl...@redhat.com> writes: > >> Now that we've asserted that all of our interpolated QMP commands >> include 'execute', we can reduce some of the caller boilerplate >> by providing a helpr function to wrap commands with no arguments > > helper > > I don't get the dependency on asserting "contains 'execute'".
As mentioned elsewhere, the assertions helped me make sure I converted all qmp() callers, but I'm fine not having it (and therefore adjusting this commit message) in the next spin. >> +void qmp_cmd_async(const char *cmd) >> +{ >> + qtest_qmp_send(global_qtest, "{'execute':%s}", cmd); >> +} >> + > > Hmm. A possibly saner naming scheme: > > FOO_send(): send a command > FOO_receive(): receive a reply > FOO: both Yes, I like it. That means s/FOO_async/FOO_send/. And to some extent, I already did that - as the name qmp_cmd() was temporary until I could get rid of all older qmp() semantics, and then end with s/qmp_cmd/qmp/ in 22/22. And since I'm already touching pretty much every client, it's no worse churn to do a sane rename in the process. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature