From: Laine Stump Date: Tue, 25 Jun 2013 23:32:07 +0000 (-0400) Subject: network: allow in type='hostdev' networks X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4b42e3b97f47c5b9e40a21eaecd18bc785118f63;p=people%2Fdariof%2Flibvirt.git network: allow in type='hostdev' networks Although SRIOV network cards support setting a vlan tag on their virtual functions, and although setting this vlan tag via a element in a domain's works, setting a vlan tag for these devices in a definition, or in a network definition is also supposed to work (and the comment that validates usage even says that!). However, the check to allow it only checked for an openvswitch network, so attempts to add to a network of type='hostdev' would fail. --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 598820995..2cf49bbce 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3154,9 +3154,11 @@ networkValidate(struct network_driver *driver, * a pool, and those using an Open vSwitch bridge. */ - vlanAllowed = (def->forward.type == VIR_NETWORK_FORWARD_BRIDGE && + vlanAllowed = ((def->forward.type == VIR_NETWORK_FORWARD_BRIDGE && def->virtPortProfile && - def->virtPortProfile->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH); + def->virtPortProfile->virtPortType + == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) || + def->forward.type == VIR_NETWORK_FORWARD_HOSTDEV); vlanUsed = def->vlan.nTags > 0; for (ii = 0; ii < def->nPortGroups; ii++) {