[PATCH 1/9] conf: Don't pass PROP_NONZERO to virXMLPropTristateBool()

Andrea Bolognani abologna at redhat.com
Fri Mar 25 16:26:44 UTC 2022


It's the default behavior.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 src/conf/domain_conf.c    | 6 +++---
 src/conf/interface_conf.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 731139f80f..1186ec8417 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7862,7 +7862,7 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt,
         seclabel->type == VIR_DOMAIN_SECLABEL_NONE)
         seclabel->relabel = false;
 
-    if (virXMLPropTristateBool(ctxt->node, "relabel", VIR_XML_PROP_NONZERO, &relabel) < 0)
+    if (virXMLPropTristateBool(ctxt->node, "relabel", VIR_XML_PROP_NONE, &relabel) < 0)
         return NULL;
 
     virTristateBoolToBool(relabel, &seclabel->relabel);
@@ -8079,7 +8079,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDef ***seclabels_rtn,
             seclabels[i]->model = g_steal_pointer(&model);
         }
 
-        if (virXMLPropTristateBool(list[i], "relabel", VIR_XML_PROP_NONZERO, &t) < 0)
+        if (virXMLPropTristateBool(list[i], "relabel", VIR_XML_PROP_NONE, &t) < 0)
             goto error;
 
         seclabels[i]->relabel = true;
@@ -8088,7 +8088,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDef ***seclabels_rtn,
         /* labelskip is only parsed on live images */
         seclabels[i]->labelskip = false;
         if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) {
-            if (virXMLPropTristateBool(list[i], "labelskip", VIR_XML_PROP_NONZERO, &t) < 0)
+            if (virXMLPropTristateBool(list[i], "labelskip", VIR_XML_PROP_NONE, &t) < 0)
                 goto error;
 
             virTristateBoolToBool(t, &seclabels[i]->labelskip);
diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index 424650489c..ba5dc9961a 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -233,7 +233,7 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDef *def,
     def->dhcp = 1;
     def->peerdns = -1;
 
-    if (virXMLPropTristateBool(dhcp, "peerdns", VIR_XML_PROP_NONZERO, &peerdns) < 0)
+    if (virXMLPropTristateBool(dhcp, "peerdns", VIR_XML_PROP_NONE, &peerdns) < 0)
         return -1;
 
     if (peerdns != VIR_TRISTATE_BOOL_ABSENT) {
-- 
2.35.1



More information about the libvir-list mailing list