From: Laine Stump Date: Thu, 15 Jan 2026 00:28:17 +0000 (-0500) Subject: conf: simplify check for vlan tagging support in virDomainActualNetDefValidate() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcffd15520be96823f006b3dac5eea3590068fd0;p=thirdparty%2Flibvirt.git conf: simplify check for vlan tagging support in virDomainActualNetDefValidate() Since the only two types of bridges we support are OVS bridges and Linux host bridges, and since both of those now support vlan tagging, we don't need to check the virtualport type etc - if there is a bridge specified then we know the interface will support vlan tagging. Signed-off-by: Laine Stump Reviewed-by: Ján Tomko --- diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 4589965923..4482203087 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2229,15 +2229,12 @@ virDomainActualNetDefValidate(const virDomainNetDef *net) if (virDomainNetGetActualVlan(net)) { /* vlan configuration via libvirt is only supported for PCI * Passthrough SR-IOV devices (hostdev or macvtap passthru - * mode) and openvswitch bridges. Otherwise log an error and - * fail + * mode) and openvswitch/linux host bridges. */ - if (!(actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV || + if (!(virDomainNetGetActualBridgeName(net) || + actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV || (actualType == VIR_DOMAIN_NET_TYPE_DIRECT && - virDomainNetGetActualDirectMode(net) == VIR_NETDEV_MACVLAN_MODE_PASSTHRU) || - (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE && - vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) || - (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE && !vport))) { + virDomainNetGetActualDirectMode(net) == VIR_NETDEV_MACVLAN_MODE_PASSTHRU))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("interface %1$s - vlan tag not supported for this connection type"), macstr);