[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 16/22] libqtest: Add qmp_cmd() helper
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 16/22] libqtest: Add qmp_cmd() helper |
Date: |
Wed, 9 Aug 2017 11:39:13 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 08/09/2017 10:40 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> 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
[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