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; def->type = VIR_DOMAIN_NET_TYPE_USER;
} }
trustGuestRxFilters = virXMLPropString(node, "trustGuestRxFilters"); if ((trustGuestRxFilters = virXMLPropString(node, "trustGuestRxFilters"))) {
if (trustGuestRxFilters && int value;
((def->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; }
def->trustGuestRxFilters = value;
} }
cur = node->children; cur = node->children;

View File

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