[libvirt] [PATCH 13/20] qemumonitortestutils: Improve error reporting from mock qemu monitor

Eric Blake eblake at redhat.com
Tue Jul 30 17:37:20 UTC 2013


On 07/30/2013 07:05 AM, Peter Krempa wrote:
> Use the JSON error messages to report errors back to the caller in
> addition to erroring out. The error reported from the event loop from
> the mock function of the monitor was later overwritten by the call to
> the monitor/agent interaction API. This will also allow testing of error
> reporting.
> ---
>  tests/qemumonitortestutils.c | 56 ++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 46 insertions(+), 10 deletions(-)

My version of gcc complains:

qemumonitortestutils.c: In function 'qemuMonitorReportError':
qemumonitortestutils.c:140:5: error: function might be possible
candidate for 'gnu_printf' format attribute
[-Werror=suggest-attribute=format]
     if (virVasprintf(&msg, errmsg, msgargs) < 0)
     ^

> @@ -132,11 +134,48 @@ qemuMonitorTestAddUnexpectedErrorResponse(qemuMonitorTestPtr test)
> 
> 
>  static int
> +qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...)

You'll need to add ATTRIBUTE_FMT_PRINTF(2, 3) to shut up the warning.

-- 
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/bd7f4781/attachment-0001.sig>


More information about the libvir-list mailing list