Please ignore this patch, i worked in a old upstream libvirt.
Sorry for the noisy.
Luyao
----- Original Message -----
From: "Luyao Huang" <lhuang(a)redhat.com>
To: libvir-list(a)redhat.com
Cc: "Luyao Huang" <lhuang(a)redhat.com>
Sent: Tuesday, December 30, 2014 5:00:03 PM
Subject: [libvirt] [PATCH] qemu: fix tc old rules will be cleaned after set tc new rules
fail
https://bugzilla.redhat.com/show_bug.cgi?id=1177723
If tc cmd failed when we use qemuDomainSetInterfaceParameters, the old
rules will be clean. Restore the old rules if tc failed.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c01da6c..810bd35 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9915,8 +9915,12 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot set bandwidth limits on %s"),
+ _("cannot set bandwidth limits on %s"
+ "- attempting to restore old settings"),
device);
+ ignore_value(virNetDevBandwidthSet(net->ifname,
+ net->bandwidth,
+ false));
goto cleanup;
}
--
1.8.3.1
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list