[libvirt PATCH 13/14] conf: Use virTristateXXX in virStoragePoolSourceDevice

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

 



Note that the comment for virStoragePoolSourceDevice::part_separator was wrong.

Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/storage_conf.c | 7 ++++---
 src/conf/storage_conf.h | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 310a062ee7..e92de7e6a3 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -617,14 +617,15 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
 
         partsep = virXMLPropString(nodeset[i], "part_separator");
         if (partsep) {
-            dev.part_separator = virTristateBoolTypeFromString(partsep);
-            if (dev.part_separator <= 0) {
+            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 (VIR_APPEND_ELEMENT(source->devices, source->ndevice, dev) < 0) {
@@ -1097,7 +1098,7 @@ virStoragePoolSourceFormat(virBufferPtr buf,
             virBufferEscapeString(buf, "<device path='%s'",
                                   src->devices[i].path);
             if (src->devices[i].part_separator !=
-                VIR_TRISTATE_SWITCH_ABSENT) {
+                VIR_TRISTATE_BOOL_ABSENT) {
                 virBufferAsprintf(buf, " part_separator='%s'",
                                   virTristateBoolTypeToString(src->devices[i].part_separator));
             }
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
index 647eb847bf..8d417af7bb 100644
--- a/src/conf/storage_conf.h
+++ b/src/conf/storage_conf.h
@@ -168,7 +168,7 @@ struct _virStoragePoolSourceDevice {
     virStoragePoolSourceDeviceExtentPtr freeExtents;
     char *path;
     int format; /* Pool specific source format */
-    int part_separator;  /* enum virTristateSwitch */
+    virTristateBool part_separator;
 
     /* When the source device is a physical disk,
      * the geometry data is needed
-- 
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