[libvirt PATCH v3 21/51] domain_conf: Use virXMLPropTristateXXX in virDomainDiskSourceNVMeParse

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4fd4fabb3f..f2fb3c8dd5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8397,7 +8397,6 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
     g_autoptr(virStorageSourceNVMeDef) nvme = NULL;
     g_autofree char *type = NULL;
     g_autofree char *namespc = NULL;
-    g_autofree char *managed = NULL;
     xmlNodePtr address;
 
     nvme = g_new0(virStorageSourceNVMeDef, 1);
@@ -8428,16 +8427,8 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
         return -1;
     }
 
-    if ((managed = virXMLPropString(node, "managed"))) {
-        int value;
-        if ((value = virTristateBoolTypeFromString(managed)) <= 0) {
-            virReportError(VIR_ERR_XML_ERROR,
-                           _("malformed managed value '%s'"),
-                           managed);
-            return -1;
-        }
-        nvme->managed = value;
-    }
+    if (virXMLPropTristateBool(node, "managed", false, &nvme->managed) < 0)
+        return -1;
 
     if (!(address = virXPathNode("./address", ctxt))) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
-- 
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