libvirt/src/network
Laine Stump eafb53fec2 network: disallow <bandwidth>/<mac> for bridged/macvtap/hostdev networks
https://bugzilla.redhat.com/show_bug.cgi?id=1057321

pointed out that we weren't honoring the <bandwidth> element in
libvirt networks using <forward mode='bridge'/>. In fact, these
networks are just a method of giving a libvirt network name to an
existing Linux host bridge on the system, and libvirt doesn't have
enough information to know where to set such limits. We are working on
a method of supporting network bandwidths for some specific cases of
<forward mode='bridge'/>, but currently libvirt doesn't support it. So
the proper thing to do now is just log an error when someone tries to
put a <bandwidth> element in that type of network. (It's unclear if we
will be able to do proper bandwidth limiting for macvtap networks, and
most definitely we will not be able to support it for hostdev
networks).

While looking through the network XML documentation and comparing it
to the networkValidate function, I noticed that we also ignore the
presence of a mac address in the config in the same cases, rather than
failing so that the user will understand that their desired action has
not been taken.

This patch updates networkValidate() (which is called any time a
persistent network is defined, or a transient network created) to log
an error and fail if it finds either a <bandwidth> or <mac> element
and the network forward mode is anything except 'route'. 'nat', or
nothing. (Yes, neither of those elements is acceptable for any macvtap
mode, nor for a hostdev network).

NB: This does *not* cause failure to start any existing network that
contains one of those elements, so someone might have erroneously
defined such a network in the past, and that network will continue to
function unmodified. I considered it too disruptive to suddenly break
working configs on the next reboot after a libvirt upgrade.
2014-02-05 15:04:58 +02:00
..
bridge_driver_linux.c Fix bridge configuration when OUTPUT policy is DROP on the host 2014-01-07 18:18:29 +01:00
bridge_driver_nop.c Add missing ATTRIBUTE_UNUSED 2013-08-12 21:30:29 +02:00
bridge_driver_platform.c bridge driver: extract platform specifics 2013-08-01 15:47:02 -06:00
bridge_driver_platform.h Added network events to the bridged network driver 2013-12-11 13:32:21 +00:00
bridge_driver.c network: disallow <bandwidth>/<mac> for bridged/macvtap/hostdev networks 2014-02-05 15:04:58 +02:00
bridge_driver.h maint: don't use config.h in .h files 2013-06-05 05:53:25 -06:00
default.xml Remove the space before the slash in network XML 2013-08-28 08:05:46 +02:00