]> xenbits.xensource.com Git - libvirt.git/commit
network: propagate <port isolated='yes'/> between network and domain
authorLaine Stump <laine@redhat.com>
Thu, 6 Feb 2020 23:15:25 +0000 (18:15 -0500)
committerLaine Stump <laine@redhat.com>
Fri, 21 Feb 2020 04:11:29 +0000 (23:11 -0500)
commitde7c347d9b7c571f19ebe0e9af4c1025a7115b5f
tree84e284f6a74db9fd2d76cacdce153c2a5df4ed56
parent31d95b182e692fb52711c5818780599f440c1f37
network: propagate <port isolated='yes'/> between network and domain

Similar to the way that the <vlan>, <bandwidth>, and <virtualport>
elements and the trustGuestRxFilters attribute in a <network> (or in
the appropriate <portgroup> element of a <network> can be applied to a
port when it is allocated for a domain's network interface, this patch
checks for a configured value of <port isolated="yes|no"/> in
either the domain <interface> or in the network, setting isolatedPort
in the <networkport> to the first one it finds (the setting from the
domain's <interface> is preferred). This, in turn, is passed back to
the domain when a port is allocated, so that the domain will use that
setting.

(One difference from <vlan>, <bandwidth>, <virtualport>, and
trustGuestRxFilters, is that all of those can be set in a <portgroup>
so that they can be applied only to a subset of interfaces connected
to the network. This didn't really make sense for the isolated setting
due to the way that it's implemented in Linux - the BR_ISOLATED flag
will prevent traffic from passing between two ports that both have
BR_ISOLATED set, but traffic can still go between those ports and
other ports that *don't* have BR_ISOLATED. (It would be nice if all
traffic from a BR_ISOLATED port could be blocked except traffic going
to/from a designated egress port or ports, but instead the entire
feature is implemented as a single flag. Because of this, it's really
only useful if all the ports on a network are isolated, so setting it
for a subset has no practical utility.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c
src/network/bridge_driver.c