]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: xml: Remove VIR_XML_PROP_WRAPNEGATIVE
authorPeter Krempa <pkrempa@redhat.com>
Wed, 21 Apr 2021 06:41:00 +0000 (08:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 21 Apr 2021 08:32:17 +0000 (10:32 +0200)
As I've pointed out in my review, the negative number wrapping for
unsigned variables is an anti-feature which should not be promoted in
any way.

Remove VIR_XML_PROP_WRAPNEGATIVE which would make it more accessible.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virxml.c
src/util/virxml.h

index 418be2a89822c1ed39aa6b943c0a5f582c25d401..5ceef7381475c51e7a413eafa99b062991020a00 100644 (file)
@@ -734,11 +734,7 @@ virXMLPropUInt(xmlNodePtr node,
         return -1;
     }
 
-    if (flags & VIR_XML_PROP_WRAPNEGATIVE) {
-        ret = virStrToLong_ui(tmp, NULL, base, &val);
-    } else {
-        ret = virStrToLong_uip(tmp, NULL, base, &val);
-    }
+    ret = virStrToLong_uip(tmp, NULL, base, &val);
 
     if (ret < 0) {
         virReportError(VIR_ERR_XML_ERROR,
index c0405a39f0bb84928e3bd5e76736a67d9bcc1305..f7ec4ef957fe119e851afd190e2102794f602dcc 100644 (file)
@@ -38,7 +38,6 @@ typedef enum {
     VIR_XML_PROP_OPTIONAL = 0, /* Attribute may be absent */
     VIR_XML_PROP_REQUIRED = 1 << 0, /* Attribute may not be absent */
     VIR_XML_PROP_NONZERO = 1 << 1, /* Attribute may not be zero */
-    VIR_XML_PROP_WRAPNEGATIVE = 1 << 2, /* Wrap around negative values */
 } virXMLPropFlags;