From: Laine Stump Date: Mon, 11 Dec 2017 19:26:54 +0000 (-0500) Subject: qemu: delete exist bandwidth restrictions when they are removed from config X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b21163bd119446dcbadab7523b1dc8dab487a571;p=libvirt.git qemu: delete exist bandwidth restrictions when they are removed from config When the of an interface is changed with update-device, the old settings are cleared with tc, then new settings added with tc. But if the ifname, - virDomainNetGetActualBandwidth(newdev), - false, - !virDomainNetTypeSharesHostView(newdev)) < 0) - goto cleanup; + virNetDevBandwidthPtr newb = virDomainNetGetActualBandwidth(newdev); + + if (newb) { + if (virNetDevBandwidthSet(newdev->ifname, newb, false, + !virDomainNetTypeSharesHostView(newdev)) < 0) + goto cleanup; + } else { + /* + * virNetDevBandwidthSet() doesn't clear any existing + * setting unless something new is being set. + */ + virNetDevBandwidthClear(newdev->ifname); + } needReplaceDevDef = true; }