]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virxml: Extend virXMLPropU{Int,LongLong}() error message
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Jan 2022 15:06:26 +0000 (16:06 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 21 Jan 2022 15:42:13 +0000 (16:42 +0100)
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>
src/util/virxml.c

index 4b09374107713c33800d9df156d10e1092e630e0..bb1ae3e305b86161998f9029a64bad3b840ed7dc 100644 (file)
@@ -679,7 +679,7 @@ virXMLPropUInt(xmlNodePtr node,
 
     if (ret < 0) {
         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);
         return -1;
     }
@@ -738,7 +738,7 @@ virXMLPropULongLong(xmlNodePtr node,
 
     if (ret < 0) {
         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);
         return -1;
     }