]> xenbits.xensource.com Git - libvirt.git/commit
networkAllocateActualDevice: Set QoS for bridgeless networks too
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Jan 2014 17:58:33 +0000 (18:58 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 27 Jan 2014 11:11:27 +0000 (12:11 +0100)
commit2996e6be19a13199ded7c2aa21039cca97318e01
tree0d05ceaad21b2c2a4dee2cb0be6d3bb92c1e920c
parent5099f745e67f2485ca5757ae46db499cdcda9058
networkAllocateActualDevice: Set QoS for bridgeless networks too

https://bugzilla.redhat.com/show_bug.cgi?id=1055484

Currently, libvirt's XML schema of network allows QoS to be defined for
every network even though it has no bridge. For instance:

<network>
    <name>vdsm-no-bridge</name>
    <forward mode='passthrough'>
      <interface dev='em1.10'/>
    </forward>
    <bandwidth>
        <inbound average='1000' peak='5000' burst='1024'/>
        <outbound average='1000' burst='1024'/>
    </bandwidth>
</network>

The bandwidth limitations can be, however, applied even on such
networks. In fact, they are going to be applied on the interface that
will be connected to the network on a domain startup. This approach,
however, has one limitation. With bridged networks, there are two points
where QoS can be set: bridge and domain interface. The lower limit of
the two is enforced then. For instance, if the interface has 10Mbps
average, but the network only 1Mbps, there's no way for interface to
transmit packets faster than the 1Mbps limit. With two points this is
enforced by kernel.  With only one point, we must combine both QoS
settings into one which is set afterwards. Look at
virNetDevBandwidthMinimal() and you'll understand immediately what I
mean.

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