mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-25 13:50:09 +03:00
util: xml: Remove VIR_XML_PROP_WRAPNEGATIVE
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>
This commit is contained in:
@ -734,11 +734,7 @@ virXMLPropUInt(xmlNodePtr node,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_XML_PROP_WRAPNEGATIVE) {
|
ret = virStrToLong_uip(tmp, NULL, base, &val);
|
||||||
ret = virStrToLong_ui(tmp, NULL, base, &val);
|
|
||||||
} else {
|
|
||||||
ret = virStrToLong_uip(tmp, NULL, base, &val);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
|
@ -38,7 +38,6 @@ typedef enum {
|
|||||||
VIR_XML_PROP_OPTIONAL = 0, /* Attribute may be absent */
|
VIR_XML_PROP_OPTIONAL = 0, /* Attribute may be absent */
|
||||||
VIR_XML_PROP_REQUIRED = 1 << 0, /* Attribute may not 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_NONZERO = 1 << 1, /* Attribute may not be zero */
|
||||||
VIR_XML_PROP_WRAPNEGATIVE = 1 << 2, /* Wrap around negative values */
|
|
||||||
} virXMLPropFlags;
|
} virXMLPropFlags;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user