From nobody Thu May 15 10:04:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1513193116895545.7559678798091; Wed, 13 Dec 2017 11:25:16 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF09691FC8; Wed, 13 Dec 2017 19:25:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 830BE784DD; Wed, 13 Dec 2017 19:25:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 45F7B180474A; Wed, 13 Dec 2017 19:25:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vBDJOAGd025554 for ; Wed, 13 Dec 2017 14:24:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id A288C7BFF6; Wed, 13 Dec 2017 19:24:10 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-202.phx2.redhat.com [10.3.117.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C0127BFFF; Wed, 13 Dec 2017 19:24:10 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com Date: Wed, 13 Dec 2017 14:24:02 -0500 Message-Id: <20171213192403.19967-2-laine@laine.org> In-Reply-To: <20171213192403.19967-1-laine@laine.org> References: <20171213192403.19967-1-laine@laine.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Michal Privoznik Subject: [libvirt] [PATCH 1/2] qemu: delete exist bandwidth restrictions when they are removed from config X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 13 Dec 2017 19:25:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 =3D virDomainNetGetActualBandwidth(newd= ev); + + if (newb) { + if (virNetDevBandwidthSet(newdev->ifname, newb, false, + !virDomainNetTypeSharesHostView(newd= ev)) < 0) + goto cleanup; + } else { + /* + * virNetDevBandwidthSet() doesn't clear any existing + * setting unless something new is being set. + */ + virNetDevBandwidthClear(newdev->ifname); + } needReplaceDevDef =3D true; } =20 --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list