[libvirt PATCH 26/38] domain_conf: Use virXMLProp(OnOff|YesNo) in virDomainMemoryDefParseXML

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c020bf9124..d4ca60f98c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15764,16 +15764,8 @@ virDomainMemoryDefParseXML(virDomainXMLOptionPtr xmlopt,
     }
     VIR_FREE(tmp);
 
-    if ((tmp = virXMLPropString(memdevNode, "discard"))) {
-        if ((val = virTristateBoolTypeFromString(tmp)) <= 0) {
-            virReportError(VIR_ERR_XML_ERROR,
-                           _("invalid discard value '%s'"), tmp);
-            goto error;
-        }
-
-        def->discard = val;
-    }
-    VIR_FREE(tmp);
+    if (virXMLPropYesNo(memdevNode, "discard", &def->discard) < 0)
+        goto error;
 
     /* Extract NVDIMM UUID. */
     if (def->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM &&
-- 
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