Signed-off-by: Tim Wiederhake <twied...@redhat.com>
---
 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 d0d03b16bb..e529eb7bc1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10865,14 +10865,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 21c34b33c2..0c3d74095e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1103,7 +1103,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

Reply via email to