Up to now developers didn't know which error code to use, when invalid
attribute/element value was given (e.g. string when expecting integer),
something was missing, etc. This patch creates a new error code for
cases like that.
---
include/libvirt/virterror.h | 1 +
src/util/virterror.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index 0708e02..2f160c9 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -231,6 +231,7 @@ typedef enum {
VIR_ERR_INVALID_DOMAIN_SNAPSHOT = 71,/* invalid domain snapshot */
VIR_ERR_NO_DOMAIN_SNAPSHOT = 72, /* domain snapshot not found */
VIR_ERR_INVALID_STREAM = 73, /* stream pointer not valid */
+ VIR_ERR_XML_CONFIG = 74, /* invalid or not well formed input XML*/
} virErrorNumber;
/**
diff --git a/src/util/virterror.c b/src/util/virterror.c
index fbb4a45..f597e9b 100644
--- a/src/util/virterror.c
+++ b/src/util/virterror.c
@@ -1205,6 +1205,12 @@ virErrorMsg(virErrorNumber error, const char *info)
else
errmsg = _("invalid stream pointer in %s");
break;
+ case VIR_ERR_XML_CONFIG:
+ if (info == NULL)
+ errmsg = _("XML parsing error: document not well formed or
invalid");
+ else
+ errmsg = _("XML parsing error: %s");
+ break;
}
return (errmsg);
}
--
1.7.4.4