提交 565d049f 编写于 作者: L Luyao Huang 提交者: Michal Privoznik

qemu: Restore old bandwidth rules when setting new fails

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

When setting new bandwidth limits via
virDomainSetInterfaceParameters, the old ones are cleared first.
However, if setting the new ones fails, the old are already gone
and interface is left in inconsistent state.  Therefore, right
before failing we ought to try to restore the old bandwidth.
Signed-off-by: NLuyao Huang <lhuang@redhat.com>
上级 a791599c
......@@ -10510,8 +10510,12 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
sizeof(*newBandwidth->out));
}
if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0)
if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0) {
ignore_value(virNetDevBandwidthSet(net->ifname,
net->bandwidth,
false));
goto endjob;
}
virNetDevBandwidthFree(net->bandwidth);
if (newBandwidth->in || newBandwidth->out) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册