conf: Use virTristateXXX in virDomainActualNetDef

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-07 13:48:32 +02:00 committed by Peter Krempa
parent a9ef3272c5
commit f1d4cd5ab3
2 changed files with 10 additions and 9 deletions

View File

@ -10574,14 +10574,15 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
goto error; goto error;
} }
trustGuestRxFilters = virXMLPropString(node, "trustGuestRxFilters"); if ((trustGuestRxFilters = virXMLPropString(node, "trustGuestRxFilters"))) {
if (trustGuestRxFilters && int value;
((actual->trustGuestRxFilters if ((value = virTristateBoolTypeFromString(trustGuestRxFilters)) <= 0) {
= virTristateBoolTypeFromString(trustGuestRxFilters)) <= 0)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown trustGuestRxFilters value '%s'"),
_("unknown trustGuestRxFilters value '%s'"), trustGuestRxFilters);
trustGuestRxFilters); goto error;
goto error; }
actual->trustGuestRxFilters = value;
} }
virtPortNode = virXPathNode("./virtualport", ctxt); virtPortNode = virXPathNode("./virtualport", ctxt);

View File

@ -995,7 +995,7 @@ struct _virDomainActualNetDef {
virNetDevVPortProfile *virtPortProfile; virNetDevVPortProfile *virtPortProfile;
virNetDevBandwidth *bandwidth; virNetDevBandwidth *bandwidth;
virNetDevVlan vlan; virNetDevVlan vlan;
int trustGuestRxFilters; /* enum virTristateBool */ virTristateBool trustGuestRxFilters;
virTristateBool isolatedPort; virTristateBool isolatedPort;
unsigned int class_id; /* class ID for bandwidth 'floor' */ unsigned int class_id; /* class ID for bandwidth 'floor' */
}; };