1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

virxml: Extend virXMLPropU{Int,LongLong}() error message

In case virXMLPropUInt() or virXMLPropULongLong() meets an
attribute with a negative integer the following error message is
printed:

  Invalid value ...: Expected integer value

This message is not as good as it could be. Let users know it's a
non-negative integer we are expecting.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-01-20 16:06:26 +01:00
parent b42e088019
commit 7b64a83ae2

View File

@ -679,7 +679,7 @@ virXMLPropUInt(xmlNodePtr node,
if (ret < 0) { if (ret < 0) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("Invalid value for attribute '%s' in element '%s': '%s'. Expected integer value"), _("Invalid value for attribute '%s' in element '%s': '%s'. Expected non-negative integer value"),
name, node->name, tmp); name, node->name, tmp);
return -1; return -1;
} }
@ -738,7 +738,7 @@ virXMLPropULongLong(xmlNodePtr node,
if (ret < 0) { if (ret < 0) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("Invalid value for attribute '%s' in element '%s': '%s'. Expected integer value"), _("Invalid value for attribute '%s' in element '%s': '%s'. Expected non-negative integer value"),
name, node->name, tmp); name, node->name, tmp);
return -1; return -1;
} }