This patch series add support for setting traffic shaping and policing
on both domain's interface and network's virtual bridge. Basically,
this is done via 'tc' from iproute2 package. For shaping is HTB used,
for policing we need u32 match selector. Both should be available in
RHEL-6 kernel.
How this works:
On an virtual interface which has limits defined a root qdisc are replaced.
Ingress root for outbound traffic shaping and egress for inbound.
Basically, in inbound traffic policing is applied, on outbound shaping.
New qdiscs are set to limit the traffic to rate set in XML. For shaping
it is possible to set the size of buffer. Accepted values for rate, peak
and burst are integer numbers. Units are kilobytes per second for rate
or kilobytes for size.
Supported devices are VIR_DOMAIN_NET_TYPE_NETWORK, VIR_DOMAIN_NET_TYPE_BRIDGE
and VIR_DOMAIN_NET_TYPE_DIRECT.
diff to v2:
-Jirka's review included
diff to v1:
-rebase to current HEAD
-add support for macvtap devices
Michal Privoznik (7):
bandwidth: Define schema and create documentation
bandwidth: Declare internal structures
bandwidth: Add parsing functions
bandwidth: Create format functions
bandwitdh: Implement functions to enable and disable QoS
bandwidth: Add test cases for network
bandwidth: Add domain schema test suite
configure.ac | 4 +
docs/formatdomain.html.in | 33 +++
docs/formatnetwork.html.in | 30 +++
docs/schemas/bandwidth.rng | 52 ++++
docs/schemas/domain.rng | 4 +
docs/schemas/network.rng | 4 +
src/conf/domain_conf.c | 6 +
src/conf/domain_conf.h | 1 +
src/conf/network_conf.c | 8 +
src/conf/network_conf.h | 1 +
src/libvirt_private.syms | 4 +
src/network/bridge_driver.c | 12 +
src/qemu/qemu_command.c | 10 +-
src/util/macvtap.c | 12 +-
src/util/macvtap.h | 5 +-
src/util/network.c | 345 +++++++++++++++++++++++++
src/util/network.h | 23 ++
tests/domainschemadata/domain-bandwidth.xml | 72 +++++
tests/networkxml2xmlin/bandwidth-network.xml | 16 ++
tests/networkxml2xmlout/bandwidth-network.xml | 16 ++
tests/networkxml2xmltest.c | 1 +
21 files changed, 655 insertions(+), 4 deletions(-)
create mode 100644 docs/schemas/bandwidth.rng
create mode 100644 tests/domainschemadata/domain-bandwidth.xml
create mode 100644 tests/networkxml2xmlin/bandwidth-network.xml
create mode 100644 tests/networkxml2xmlout/bandwidth-network.xml
--
1.7.5.rc3