[libvirt PATCH 02/14] conf: Use virTristateXXX in virStorageSourceNVMeDef

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b8f6c3d606..dfdca1891a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8480,12 +8480,14 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node,
     }
 
     if ((managed = virXMLPropString(node, "managed"))) {
-        if ((nvme->managed = virTristateBoolTypeFromString(managed)) <= 0) {
+        int value;
+        if ((value = virTristateBoolTypeFromString(managed)) <= 0) {
             virReportError(VIR_ERR_XML_ERROR,
                            _("malformed managed value '%s'"),
                            managed);
             return -1;
         }
+        nvme->managed = value;
     }
 
     if (!(address = virXPathNode("./address", ctxt))) {
diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h
index e6702a1ffc..1783dc195e 100644
--- a/src/conf/storage_source_conf.h
+++ b/src/conf/storage_source_conf.h
@@ -251,7 +251,7 @@ typedef struct _virStorageSourceNVMeDef virStorageSourceNVMeDef;
 typedef virStorageSourceNVMeDef *virStorageSourceNVMeDefPtr;
 struct _virStorageSourceNVMeDef {
     unsigned long long namespc;
-    int managed; /* enum virTristateBool */
+    virTristateBool managed;
     virPCIDeviceAddress pciAddr;
 
     /* Don't forget to update virStorageSourceNVMeDefCopy */
-- 
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