From nobody Sat Feb 7 11:05:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1609764949; cv=none; d=zohomail.com; s=zohoarc; b=MqbK/xrICb97jhJi6h4+o5e0BRYPvwxAypIU4FbYNGiobKUXLXT/Rpwd+wj7kGjufYwNzAagsh3a1GBjiSMlOTwHGuX3ONdpSOUH+kseeWIknaYrkKWf0MY9L9CIcf+/wfExHyqKWIppu06C/47s0PXSkLwlbVVgctdn7oPo4Tc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609764949; h=Content-Type:Content-Transfer-Encoding:Cc: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=EjbEfAed2K+HMHV/XZcX9bWas/cLjN98h+t+5Z6wnAU=; b=KCOAtQZYXOe80fXiVZnxkFRO/ErJf3U8+nPuivJ5TBdoRYl7g+kb/AeUy/m+OL0mm6lWIp2zegbqpK3Renc8QVT+XrZefPFMLuk9b+M5d7uMOyNcUZhkZi9ez6UFYADbzSo7hN+Sq84bQEpYEvAWrMt33UaIFuJqDd84FrOWIjc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1609764949557526.5791480362769; Mon, 4 Jan 2021 04:55:49 -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-410-jElOaFt9PLS50aG3gi3ESw-1; Mon, 04 Jan 2021 07:55:46 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF5BAC73AA; Mon, 4 Jan 2021 12:55:40 +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 C36C46E50A; Mon, 4 Jan 2021 12:55:40 +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 89BF550045; Mon, 4 Jan 2021 12:55:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 104CtUqw014453 for ; Mon, 4 Jan 2021 07:55:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id C06AF112D405; Mon, 4 Jan 2021 12:55:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBF23112D404 for ; Mon, 4 Jan 2021 12:55:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A9F84185A794 for ; Mon, 4 Jan 2021 12:55:30 +0000 (UTC) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-JUKK9G_mPiORq6W32nus8A-1; Mon, 04 Jan 2021 07:55:28 -0500 Received: by mail-qk1-f180.google.com with SMTP id d14so23149497qkc.13 for ; Mon, 04 Jan 2021 04:55:28 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:ca55:7a5d:da5b:906f:bedd]) by smtp.gmail.com with ESMTPSA id m64sm2342866qkb.90.2021.01.04.04.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 04:55:27 -0800 (PST) X-MC-Unique: jElOaFt9PLS50aG3gi3ESw-1 X-MC-Unique: JUKK9G_mPiORq6W32nus8A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EjbEfAed2K+HMHV/XZcX9bWas/cLjN98h+t+5Z6wnAU=; b=MdNngcy0VkMLMDEdUOO3gB/TpHsNbUDo9CQKIeIEDmWH7mO9fVTkRs0AsgWdgvk88n h6InQdjrtZ/9XYg4g2nRa2yAUXVKZA2xLLbTg/nfGiccUXcVEqk7vrtoWqph1miEfQAg ddYz9evsT54Fp7wUxjKvn6AUmgL+VJiL7kGsg3T1ZQlUHobGSGDwTMCSlWrmJOnWs6Pw Pd49UwSnCDHCuX1JRXvUMJ30dxqDVot/OGh0C5JU1YLhYEfiBVwjVz+T+X6Ky24hcaU2 f51uuy6cZQfjZtRG9vIbynDi6cDTAqRmWdYVR7p0bVaYkskBfLCypMo+058ACqe1cwnU ew3Q== X-Gm-Message-State: AOAM532mNuimn2gfXz08G4wtiPm4vXqER8lUvbve5LTJx5o+VAPJ0kzw eWJkVja+1qUmD1jYsGQnFIvJ4GBam/0wyw== X-Google-Smtp-Source: ABdhPJyqZBZenCFDr/F5NYmubXjPxnADZn9aEzIIqXoLIztPH4Pw+2ZkA3kfgFv4ZCGegiftJtQv5g== X-Received: by 2002:ae9:c013:: with SMTP id u19mr70772695qkk.59.1609764928133; Mon, 04 Jan 2021 04:55:28 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 19/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListDel() Date: Mon, 4 Jan 2021 09:54:43 -0300 Message-Id: <20210104125444.200536-20-danielhb413@gmail.com> In-Reply-To: <20210104125444.200536-1-danielhb413@gmail.com> References: <20210104125444.200536-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This change will allow us to remove PCI devices from a list without the need of a PCI Device object, which will be need in the next patch. Signed-off-by: Daniel Henrique Barboza --- src/hypervisor/virhostdev.c | 7 ++++--- src/util/virpci.c | 6 +++--- src/util/virpci.h | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c index 4539c55e09..0510eb020c 100644 --- a/src/hypervisor/virhostdev.c +++ b/src/hypervisor/virhostdev.c @@ -1005,11 +1005,11 @@ virHostdevReAttachPCIDevicesImpl(virHostdevManagerP= tr mgr, if (STRNEQ_NULLABLE(drv_name, actual_drvname) || STRNEQ_NULLABLE(dom_name, actual_domname)) { =20 - virPCIDeviceListDel(pcidevs, pci); + virPCIDeviceListDel(pcidevs, virPCIDeviceGetAddress(pci)); continue; } } else { - virPCIDeviceListDel(pcidevs, pci); + virPCIDeviceListDel(pcidevs, virPCIDeviceGetAddress(pci)); continue; } =20 @@ -2524,7 +2524,8 @@ virHostdevUpdateActiveNVMeDevices(virHostdevManagerPt= r hostdev_mgr, while (lastGoodPCIIdx >=3D 0) { virPCIDevicePtr actual =3D virPCIDeviceListGet(pciDevices, i); =20 - virPCIDeviceListDel(hostdev_mgr->activePCIHostdevs, actual); + virPCIDeviceListDel(hostdev_mgr->activePCIHostdevs, + virPCIDeviceGetAddress(actual)); =20 lastGoodPCIIdx--; } diff --git a/src/util/virpci.c b/src/util/virpci.c index 8973c7c754..cbf49357c6 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1336,7 +1336,7 @@ virPCIDeviceReattach(virPCIDevicePtr dev, /* Steal the dev from list inactiveDevs */ if (inactiveDevs) { VIR_DEBUG("Removing PCI device %s from inactive list", dev->name); - virPCIDeviceListDel(inactiveDevs, dev); + virPCIDeviceListDel(inactiveDevs, &dev->address); } =20 return 0; @@ -1750,9 +1750,9 @@ virPCIDeviceListSteal(virPCIDeviceListPtr list, =20 void virPCIDeviceListDel(virPCIDeviceListPtr list, - virPCIDevicePtr dev) + virPCIDeviceAddressPtr devAddr) { - virPCIDeviceFree(virPCIDeviceListSteal(list, &dev->address)); + virPCIDeviceFree(virPCIDeviceListSteal(list, devAddr)); } =20 int diff --git a/src/util/virpci.h b/src/util/virpci.h index e3458a75fa..eb71eb4451 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -165,7 +165,7 @@ virPCIDevicePtr virPCIDeviceListSteal(virPCIDeviceListP= tr list, virPCIDevicePtr virPCIDeviceListStealIndex(virPCIDeviceListPtr list, int idx); void virPCIDeviceListDel(virPCIDeviceListPtr list, - virPCIDevicePtr dev); + virPCIDeviceAddressPtr devAddr); virPCIDevicePtr virPCIDeviceListFind(virPCIDeviceListPtr list, virPCIDeviceAddressPtr devAddr); virPCIDevicePtr --=20 2.26.2