]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bridge_driver: Introduce networkBandwidthUpdate
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 31 Jul 2015 15:31:20 +0000 (17:31 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 11 Aug 2015 14:10:32 +0000 (16:10 +0200)
commit812932bea2c703d4031f947096f8efaf21b662bf
tree91a0de6cfcb004cc24a1581b81285500e05ade81
parent41a1531de54476310572f694c0b9cb9c63d4191d
bridge_driver: Introduce networkBandwidthUpdate

So, if a domain vNIC's bandwidth has been successfully set, it's
possible that because @floor is set on network's bridge, this
part may need updating too. And that's exactly what this function
does. While the previous commit introduced a function to check if
@floor can be satisfied, this does all the hard work. In general,
there may be three, well four possibilities:

  1) No change in @floor value (either it remain unset, or its
  value hasn't changed)

  2) The @floor value has changed from a non-zero to a non-zero
  value

  3) New @floor is to be set

  4) Old @floor must be cleared out

The difference between 2), 3) and 4) is, that while in 2) the QoS
tree on the network's bridge already has a special class for the
vNIC, in 3) the class must be created from scratch. In 4) it must
be removed. Fortunately, we have helpers for all three
interesting cases.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/network/bridge_driver.c
src/network/bridge_driver.h