[libvirt PATCH v3 06/51] conf: Use virTristateXXX in virDomainNetDef

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 8e94860b51..9f59756119 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10854,14 +10854,15 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
         def->type = VIR_DOMAIN_NET_TYPE_USER;
     }
 
-    trustGuestRxFilters = virXMLPropString(node, "trustGuestRxFilters");
-    if (trustGuestRxFilters &&
-        ((def->trustGuestRxFilters
-          = virTristateBoolTypeFromString(trustGuestRxFilters)) <= 0)) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("unknown trustGuestRxFilters value '%s'"),
-                       trustGuestRxFilters);
-        goto error;
+    if ((trustGuestRxFilters = virXMLPropString(node, "trustGuestRxFilters"))) {
+        int value;
+        if ((value = virTristateBoolTypeFromString(trustGuestRxFilters)) <= 0) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("unknown trustGuestRxFilters value '%s'"),
+                           trustGuestRxFilters);
+            goto error;
+        }
+        def->trustGuestRxFilters = value;
     }
 
     cur = node->children;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 90079d7e64..15dc416384 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1102,7 +1102,7 @@ struct _virDomainNetDef {
     GHashTable *filterparams;
     virNetDevBandwidthPtr bandwidth;
     virNetDevVlan vlan;
-    int trustGuestRxFilters; /* enum virTristateBool */
+    virTristateBool trustGuestRxFilters;
     virTristateBool isolatedPort;
     int linkstate;
     unsigned int mtu;
-- 
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