]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Santize the reporting of VIR_ERR_INVALID_ERROR
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 25 May 2012 17:41:07 +0000 (18:41 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 28 May 2012 15:47:25 +0000 (16:47 +0100)
commitd91f3ef49741f1b9143865ff6ef9e2119fbeccc2
treefc87d53dc3d8df16e532720059fa241ec098cf97
parent1d22ba953b646d8681c334abd30f1a2e5441a720
Santize the reporting of VIR_ERR_INVALID_ERROR

To ensure consistent error reporting of invalid arguments,
provide a number of predefined helper methods & macros.

 - An arg which must not be NULL:

   virCheckNonNullArgReturn(argname, retvalue)
   virCheckNonNullArgGoto(argname, label)

 - An arg which must be NULL

   virCheckNullArgGoto(argname, label)

 - An arg which must be positive (ie 1 or greater)

   virCheckPositiveArgGoto(argname, label)

 - An arg which must not be 0

   virCheckNonZeroArgGoto(argname, label)

 - An arg which must be zero

   virCheckZeroArgGoto(argname, label)

 - An arg which must not be negative (ie 0 or greater)

   virCheckNonNegativeArgGoto(argname, label)

* src/libvirt.c, src/libvirt-qemu.c,
  src/nodeinfo.c, src/datatypes.c: Update to use
  virCheckXXXX macros
* po/POTFILES.in: Add libvirt-qemu.c and virterror_internal.h
* src/internal.h: Define macros for checking invalid args
* src/util/virterror_internal.h: Define macros for reporting
  invalid args

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
po/POTFILES.in
src/datatypes.c
src/internal.h
src/libvirt-qemu.c
src/libvirt.c
src/nodeinfo.c
src/util/virterror_internal.h