[libvirt] [PATCH 14/20] qemumonitortestutils: Add the ability to check arguments of commands

Eric Blake eblake at redhat.com
Tue Jul 30 16:48:54 UTC 2013


On 07/30/2013 07:05 AM, Peter Krempa wrote:
> This patch adds helpers that allow to check for argument values in
> commands sent to the monitor.
> ---
>  tests/qemumonitortestutils.c | 174 ++++++++++++++++++++++++++++++++++++++++---
>  tests/qemumonitortestutils.h |   5 ++
>  2 files changed, 170 insertions(+), 9 deletions(-)

> +                                     "Missing arguments section for command '%s'",
> +                                     data->command_name);
> +        goto cleanup;
> +    }
> +
> +        /* validate the args */
> +    for (i = 0; i < data->nargs; i++) {

Indentation of the comment is off.

> +++ b/tests/qemumonitortestutils.h
> @@ -34,6 +34,11 @@ qemuMonitorTestAddItem(qemuMonitorTestPtr test,
> 
>  int qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr test);
> 
> +int qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
> +                                 const char *cmdname,
> +                                 const char *response,
> +                                 ...);

Might be worth adding an ATTRIBUTE_SENTINEL on the prototype of this
function, so that gcc ensures that a caller ends the list with a NULL.

ACK with those fixes.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130730/b817431b/attachment-0001.sig>


More information about the libvir-list mailing list