mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
qemu: Restore default root qdisc when QoS is cleared out
When an interface has some bandwidth limitation set (it's root
qdisc is htb in that case) but this gets cleared out via public
API call (virDomainSetInterfaceParameters() or
virDomainUpdateDeviceFlags()) then virNetDevBandwidthSet() clears
out whatever qdiscs were set on the interface and kernel places
the default qdisc at the root. What we need to do next is to
replace the root qdisc with the one we want.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329644
Fixes: 0b66196d86
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
abb1554a2d
commit
d53b092353
@ -10339,6 +10339,15 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
/* If the old bandwidth was cleared out, restore qdisc. */
|
||||
if (virDomainNetTypeSharesHostView(net)) {
|
||||
if (!newBandwidth->out || newBandwidth->out->average == 0)
|
||||
qemuDomainInterfaceSetDefaultQDisc(driver, net);
|
||||
} else {
|
||||
if (!newBandwidth->in || newBandwidth->in->average == 0)
|
||||
qemuDomainInterfaceSetDefaultQDisc(driver, net);
|
||||
}
|
||||
|
||||
virNetDevBandwidthFree(net->bandwidth);
|
||||
if (newBandwidth->in || newBandwidth->out) {
|
||||
net->bandwidth = newBandwidth;
|
||||
|
@ -3881,6 +3881,15 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
*/
|
||||
virNetDevBandwidthClear(newdev->ifname);
|
||||
}
|
||||
|
||||
/* If the old bandwidth was cleared out, restore qdisc. */
|
||||
if (virDomainNetTypeSharesHostView(newdev)) {
|
||||
if (!newb->out || newb->out->average == 0)
|
||||
qemuDomainInterfaceSetDefaultQDisc(driver, newdev);
|
||||
} else {
|
||||
if (!newb->in || newb->in->average == 0)
|
||||
qemuDomainInterfaceSetDefaultQDisc(driver, newdev);
|
||||
}
|
||||
needReplaceDevDef = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user