From nobody Sun Feb 8 23:03:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1610999694; cv=none; d=zohomail.com; s=zohoarc; b=FWKmAToj9PMHR5izD+UFNpD9UOIdPCMDf0Y87h2YlKSSXQAJ2z3mPOKLWt6cN9S0HpPpHaM7FrlJ7jz31zjR0RGGvjDdIEPRLLArbtsUit/o3rH0Sd7otzRO1yaR7OvNMYeyQA9PSDsKcfWsnKeARKNgqtdhvKG8uWoDwKwkMyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610999694; 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=gosnU1ZfOoPuzn8m+Da2mtmkvv9fOhCjLWrNcgsz548=; b=AeCZ4C+1Ez0qK9bngbrSEAm/j0Ts32lRPMqsILxCrHRfj70wwbTSCQ1PbzJ5AQFa5Njh5u+Q6P0KGXs82fDFYaCn2krb/9k8+vspF/mzyVxn5xrUUIiN9OH624TaR3TmncBXRAxi3cYmo6K4Uu+78XFb6mW223hX61AExQfr2rA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610999694377749.7560518098664; Mon, 18 Jan 2021 11:54:54 -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-541-eoVHBUWhNeyoG-ajnRamUQ-1; Mon, 18 Jan 2021 14:54:51 -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 61B8D802B4A; Mon, 18 Jan 2021 19:54:45 +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 3B23F10023B4; Mon, 18 Jan 2021 19:54:45 +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 048501809CB2; Mon, 18 Jan 2021 19:54:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10IJsNuv032695 for ; Mon, 18 Jan 2021 14:54:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2E82063796; Mon, 18 Jan 2021 19:54:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2884B6379F for ; Mon, 18 Jan 2021 19:54:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 CC9BF802D2A for ; Mon, 18 Jan 2021 19:54:19 +0000 (UTC) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-476-7pNU9XOROAy8hbr6qTmP2Q-1; Mon, 18 Jan 2021 14:54:16 -0500 Received: by mail-qv1-f45.google.com with SMTP id h13so8090137qvo.1 for ; Mon, 18 Jan 2021 11:54:16 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:a75a:cb34:ba60:6de6:be1d]) by smtp.gmail.com with ESMTPSA id 16sm11309085qkf.112.2021.01.18.11.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 11:54:15 -0800 (PST) X-MC-Unique: eoVHBUWhNeyoG-ajnRamUQ-1 X-MC-Unique: 7pNU9XOROAy8hbr6qTmP2Q-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=gosnU1ZfOoPuzn8m+Da2mtmkvv9fOhCjLWrNcgsz548=; b=s0J3eieOHW806VFMv5H5Xxmurhesx/cCWdvUJ6CLBismGUjxD5qntBVJ0v1QiBslzw MDxiUoFr5MHu+xkC/xFBl2EGaSyEkLRsiYHDmLapNoeXHugfc6w6M9a0oSCnbvTyc/py OGCHQ8S+F0G3vhe4he4VrEbzhEetSBRprN28PSOttBeFHIRC1Hnfs3i2yGKyIyYKW1uz xxmm20CwKiyB270fE6BJG9n9BvTjb4w0Y63X21YPfWRUsXfZ9/rqXDkctD1m6f3eHeKr QuRR1Uw4ZMNPShekbIH09PqqkUeNXClee1YbKaqttjzg1CI6wEGlA03z/Oc3ojXCucZm hxWw== X-Gm-Message-State: AOAM531rAj8HD9VVMRLzEcamFdTK7gNVIlnf8d1TIsvwQvjcd418FKm9 Q3L6hvSIESri+p0RgEKxByCNPEPD7VeStw== X-Google-Smtp-Source: ABdhPJxBqpBIAsI8KliyB9j+1un7lCB/6L2pnobHsixGDCtkRiJIEcqLsLbY+gHCgY8KXCyzizPGlw== X-Received: by 2002:a05:6214:80d:: with SMTP id df13mr1066332qvb.10.1610999656101; Mon, 18 Jan 2021 11:54:16 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND 19/20] virpci.c: use virPCIDeviceAddressPtr in virPCIDeviceListDel() Date: Mon, 18 Jan 2021 16:53:35 -0300 Message-Id: <20210118195336.2090823-20-danielhb413@gmail.com> In-Reply-To: <20210118195336.2090823-1-danielhb413@gmail.com> References: <20210118195336.2090823-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.79 on 10.11.54.5 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.84 on 10.5.11.22 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 Reviewed-by: Laine Stump --- 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 4042f874d6..c708791eec 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 @@ -2522,7 +2522,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 332e681c43..76dfd71802 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