[libvirt PATCH v2 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 | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index fa8bcfb8ce..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,16 +614,10 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
             goto cleanup;
         }
 
-        partsep = virXMLPropString(nodeset[i], "part_separator");
-        if (partsep) {
-            dev.part_separator = virTristateBoolTypeFromString(partsep);
-            if (dev.part_separator <= 0) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                               _("invalid part_separator setting '%s'"),
-                               partsep);
-                virStoragePoolSourceDeviceClear(&dev);
-                goto cleanup;
-            }
+        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