From nobody Sun Feb 8 13:16:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582389463; cv=none; d=zohomail.com; s=zohoarc; b=V+c7uSPLG/I9AtuW4CiJdMh4Z0stjPH8D/t32wdnOejsGfABoiYLZd7KIOib7A24UxptPB7441vikc9RI9wthQO19qFt9CUYTIgmN1oUyPA49SJogNMyOtfDfO1pRZLU8zKi6TMdfg/NHGfwYTsI80VskVIJInIHdWqyZhGkkD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582389463; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ITMLiU0vn3lLGE8dAk2jZXFA+jMRwv12aC00SwoLxEs=; b=kT0ncH/FIArYvcl3KIbbjX7bG3KseliCTNqyiM8aMyIwcnS/xdXov4mucK8+O4IjfIc201SIDLVjlzpPU+vpDOOBBym1wsV8afGAH9GqYMd/ZHuhCP3N+hdRWEW7r1eDMWnlhsmocw9cRVyipF/WMeMaIaEKEaCOksB8/Z0kK90= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1582389463277213.2479827869788; Sat, 22 Feb 2020 08:37:43 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-294-oIRUyuT_POqZDjbIPtFssQ-1; Sat, 22 Feb 2020 11:37:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 673A2800D54; Sat, 22 Feb 2020 16:37:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D9AE1001281; Sat, 22 Feb 2020 16:37:34 +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 F1835860D1; Sat, 22 Feb 2020 16:37:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01MGWFrX013614 for ; Sat, 22 Feb 2020 11:32:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id B82DF5C1C3; Sat, 22 Feb 2020 16:32:15 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 136325C1B5 for ; Sat, 22 Feb 2020 16:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582389462; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ITMLiU0vn3lLGE8dAk2jZXFA+jMRwv12aC00SwoLxEs=; b=g2DxrlN9p5s99cVFwzUlOowX1UxtJ85KE3ahgHg7AeJLqSS75qeyhIH5zE+6OcwYI7u37t J8GPZx+t/YDO5ZpVr/n/OF4XJhlS0KLNeacV6gLGe8NtyROd3RqjA+VD97+GDZ0FxETgA+ GF8ULgZuV/NmQn6wdCUEgIlkrNiUt+Y= X-MC-Unique: oIRUyuT_POqZDjbIPtFssQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/8] conf: do not pass vm object to virDomainClearNetBandwidth Date: Sat, 22 Feb 2020 17:31:57 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This function only uses the domain definition. Signed-off-by: J=C3=A1n Tomko --- src/conf/netdev_bandwidth_conf.c | 10 +++++----- src/conf/netdev_bandwidth_conf.h | 2 +- src/qemu/qemu_process.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conf/netdev_bandwidth_conf.c b/src/conf/netdev_bandwidth_c= onf.c index 2fe0499638..396ac62019 100644 --- a/src/conf/netdev_bandwidth_conf.c +++ b/src/conf/netdev_bandwidth_conf.c @@ -285,16 +285,16 @@ virNetDevBandwidthFormat(const virNetDevBandwidth *de= f, } =20 void -virDomainClearNetBandwidth(virDomainObjPtr vm) +virDomainClearNetBandwidth(virDomainDefPtr def) { size_t i; virDomainNetType type; =20 - for (i =3D 0; i < vm->def->nnets; i++) { - type =3D virDomainNetGetActualType(vm->def->nets[i]); - if (virDomainNetGetActualBandwidth(vm->def->nets[i]) && + for (i =3D 0; i < def->nnets; i++) { + type =3D virDomainNetGetActualType(def->nets[i]); + if (virDomainNetGetActualBandwidth(def->nets[i]) && virNetDevSupportsBandwidth(type)) - virNetDevBandwidthClear(vm->def->nets[i]->ifname); + virNetDevBandwidthClear(def->nets[i]->ifname); } } =20 diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_c= onf.h index 5a70cb6bba..34046eacd7 100644 --- a/src/conf/netdev_bandwidth_conf.h +++ b/src/conf/netdev_bandwidth_conf.h @@ -34,7 +34,7 @@ int virNetDevBandwidthFormat(const virNetDevBandwidth *de= f, unsigned int class_id, virBufferPtr buf); =20 -void virDomainClearNetBandwidth(virDomainObjPtr vm) +void virDomainClearNetBandwidth(virDomainDefPtr def) ATTRIBUTE_NONNULL(1); =20 bool virNetDevSupportsBandwidth(virDomainNetType type); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 8c1ed76677..3099099819 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7348,7 +7348,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, } =20 /* Clear network bandwidth */ - virDomainClearNetBandwidth(vm); + virDomainClearNetBandwidth(vm->def); =20 virDomainConfVMNWFilterTeardown(vm); =20 --=20 2.24.1