error: New convenience function error_report_err()
commit2ee2f1e41517efa7b5dd604a68ceca9b1377de2c
authorMarkus Armbruster <armbru@redhat.com>
Fri, 6 Feb 2015 14:27:19 +0000 (6 15:27 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 18 Feb 2015 09:50:43 +0000 (18 10:50 +0100)
tree21d8a1e36e83e83aba5cc549aa1d7a5c2ca06d83
parent248337e178fbcf1c20132d4f3d1033cb0dde7638
error: New convenience function error_report_err()

I've typed error_report("%s", error_get_pretty(ERR)) too many times
already, and I've fixed too many instances of qerror_report_err(ERR)
to error_report("%s", error_get_pretty(ERR)) as well.  Capture the
pattern in a convenience function.

Since it's almost invariably followed by error_free(), stuff that into
the convenience function as well.

The next patch will put it to use.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
include/qapi/error.h
util/error.c