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

View File

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