[PATCH 01/12] virxml: Extend virXMLPropU{Int, LongLong}() error message

Michal Privoznik mprivozn at redhat.com
Fri Jan 21 13:28:08 UTC 2022


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 at redhat.com>
---
 src/util/virxml.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virxml.c b/src/util/virxml.c
index 4b09374107..bb1ae3e305 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -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;
     }
-- 
2.34.1




More information about the libvir-list mailing list