include: error: Add enum sentinel for virErrorNumber enum

We do have one for the error domain but not for the error number itself.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Peter Krempa 2018-11-12 13:17:21 +01:00
parent 568a417224
commit 590cc60de5
2 changed files with 6 additions and 0 deletions

View File

@ -321,6 +321,11 @@ typedef enum {
VIR_ERR_DEVICE_MISSING = 99, /* fail to find the desired device */
VIR_ERR_INVALID_NWFILTER_BINDING = 100, /* invalid nwfilter binding */
VIR_ERR_NO_NWFILTER_BINDING = 101, /* no nwfilter binding */
# ifdef VIR_ENUM_SENTINELS
VIR_ERR_NUMBER_LAST
# endif
} virErrorNumber;
/**

View File

@ -914,6 +914,7 @@ virErrorMsg(virErrorNumber error, const char *info)
const char *errmsg = NULL;
switch (error) {
case VIR_ERR_NUMBER_LAST:
case VIR_ERR_OK:
return NULL;
case VIR_ERR_INTERNAL_ERROR: