conf: Use virTristateXXX in virDomainNetDef

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:33 +02:00 committed by Peter Krempa
parent f1d4cd5ab3
commit 6609b64701
2 changed files with 10 additions and 9 deletions

View File

@ -10877,14 +10877,15 @@ virDomainNetDefParseXML(virDomainXMLOption *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;

View File

@ -1103,7 +1103,7 @@ struct _virDomainNetDef {
GHashTable *filterparams;
virNetDevBandwidth *bandwidth;
virNetDevVlan vlan;
int trustGuestRxFilters; /* enum virTristateBool */
virTristateBool trustGuestRxFilters;
virTristateBool isolatedPort;
int linkstate;
unsigned int mtu;