[libvirt PATCH v3 51/51] storage_conf: Use virXMLPropTristateXXX in virStoragePoolDefParseSource

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

 



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

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 6116b04d44..286cdf105d 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -605,7 +605,6 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
         goto cleanup;
 
     for (i = 0; i < nsource; i++) {
-        g_autofree char *partsep = NULL;
         virStoragePoolSourceDevice dev = { .path = NULL };
         dev.path = virXMLPropString(nodeset[i], "path");
 
@@ -615,17 +614,10 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
             goto cleanup;
         }
 
-        partsep = virXMLPropString(nodeset[i], "part_separator");
-        if (partsep) {
-            int value = virTristateBoolTypeFromString(partsep);
-            if (value <= 0) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                               _("invalid part_separator setting '%s'"),
-                               partsep);
-                virStoragePoolSourceDeviceClear(&dev);
-                goto cleanup;
-            }
-            dev.part_separator = value;
+        if (virXMLPropTristateBool(nodeset[i], "part_separator", false,
+                                   &dev.part_separator) < 0) {
+            virStoragePoolSourceDeviceClear(&dev);
+            goto cleanup;
         }
 
         if (VIR_APPEND_ELEMENT(source->devices, source->ndevice, dev) < 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