[PATCH] Add support for bandwidth filtering on LXC guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Call virBandwidthEnable after creating the LXC veth, so that any
bandwidth controls get applied

* src/lxc/lxc_driver.c: Enable bandwidth limiting
---
 src/lxc/lxc_driver.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 4b62600..c8e6119 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;
-- 
1.7.6.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]