[libvirt PATCH 36/38] numa_conf: Use virXMLProp(OnOff|YesNo) in virDomainNumaDefParseXML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/numa_conf.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index 64b93fd7d1..d16a44c955 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -1079,17 +1079,8 @@ virDomainNumaDefParseXML(virDomainNumaPtr def,
             VIR_FREE(tmp);
         }
 
-        if ((tmp = virXMLPropString(nodes[i], "discard"))) {
-            if ((rc = virTristateBoolTypeFromString(tmp)) <= 0) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                               _("Invalid 'discard' attribute value '%s'"),
-                               tmp);
-                goto cleanup;
-            }
-
-            def->mem_nodes[cur_cell].discard = rc;
-            VIR_FREE(tmp);
-        }
+        if (virXMLPropYesNo(nodes[i], "discard", &def->mem_nodes[cur_cell].discard) < 0)
+            goto cleanup;
 
         /* Parse NUMA distances info */
         if (virDomainNumaDefNodeDistanceParseXML(def, ctxt, cur_cell) < 0)
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux