[libvirt] [PATCH 01/13] Introduce virReportError macro for general error reporting
Eric Blake
eblake at redhat.com
Wed Jul 18 11:59:54 UTC 2012
On 07/18/2012 05:52 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> Nearly every source file does something like
>
> #define VIR_FROM_THIS VIR_FROM_FOO
> #define virFooReportErorr(code, ...) \
> virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
> __FUNCTION__, __LINE__, \
> __VA_ARGS__)
>
> This creates needless duplication and inconsistent error
> reporting function names in each file. It is trivial to
> just have virterror_internal.h provide a virReportError
> macro that is equivalent
>
> * src/util/virterror_internal.h: Define virReportError(code, ...)
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> cfg.mk | 1 +
> src/util/virterror_internal.h | 3 +++
> 2 files changed, 4 insertions(+)
ACK. The real trick will be using it in all the followup patches :)
--
Eric Blake eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120718/8155fded/attachment-0001.sig>
More information about the libvir-list
mailing list