提交 590cc60d 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 568a4172
...@@ -321,6 +321,11 @@ typedef enum { ...@@ -321,6 +321,11 @@ typedef enum {
VIR_ERR_DEVICE_MISSING = 99, /* fail to find the desired device */ VIR_ERR_DEVICE_MISSING = 99, /* fail to find the desired device */
VIR_ERR_INVALID_NWFILTER_BINDING = 100, /* invalid nwfilter binding */ VIR_ERR_INVALID_NWFILTER_BINDING = 100, /* invalid nwfilter binding */
VIR_ERR_NO_NWFILTER_BINDING = 101, /* no nwfilter binding */ VIR_ERR_NO_NWFILTER_BINDING = 101, /* no nwfilter binding */
# ifdef VIR_ENUM_SENTINELS
VIR_ERR_NUMBER_LAST
# endif
} virErrorNumber; } virErrorNumber;
/** /**
......
...@@ -914,6 +914,7 @@ virErrorMsg(virErrorNumber error, const char *info) ...@@ -914,6 +914,7 @@ virErrorMsg(virErrorNumber error, const char *info)
const char *errmsg = NULL; const char *errmsg = NULL;
switch (error) { switch (error) {
case VIR_ERR_NUMBER_LAST:
case VIR_ERR_OK: case VIR_ERR_OK:
return NULL; return NULL;
case VIR_ERR_INTERNAL_ERROR: case VIR_ERR_INTERNAL_ERROR:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册