From: Daniel P. Berrange Date: Mon, 3 Oct 2011 17:25:10 +0000 (+0100) Subject: Add support for bandwidth filtering on LXC guests X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6cc9ee9b18788d57971eee81f3183fcd89b0dc24;p=libvirt.git Add support for bandwidth filtering on LXC guests Call virBandwidthEnable after creating the LXC veth, so that any bandwidth controls get applied * src/lxc/lxc_driver.c: Enable bandwidth limiting --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 4b62600624..c8e611992a 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1166,6 +1166,14 @@ static int lxcSetupInterfaces(virConnectPtr conn, if (vethInterfaceUpOrDown(parentVeth, 1) < 0) goto error_exit; + if (virBandwidthEnable(virDomainNetGetActualBandwidth(def->nets[i]), + def->nets[i]->ifname) < 0) { + lxcError(VIR_ERR_INTERNAL_ERROR, + _("cannot set bandwidth limits on %s"), + def->nets[i]->ifname); + goto error_exit; + } + if (def->nets[i]->filter && virDomainConfNWFilterInstantiate(conn, def->nets[i]) < 0) goto error_exit;