]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Introduce virReportError macro for general error reporting
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 18 Jul 2012 10:23:56 +0000 (11:23 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 18 Jul 2012 13:01:10 +0000 (14:01 +0100)
commit7e94acd4fc470ea46ab94f21f7fe718d512ca3b1
treeed6b3bb193ae5152ad054173562b780d2ec44957
parent17f3be079c3c421eff203fcd311b0357ec42d801
Introduce virReportError macro for general error reporting

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@redhat.com>
cfg.mk
src/util/virterror_internal.h