From nobody Tue Nov 26 17:17:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1706290445; cv=none; d=zohomail.com; s=zohoarc; b=FVMu/3epV/B3x90jSWV6bstBE3F/VPIsImoGTBwkSnJnWEqcSXWeqUbped3/3qxTSllLwom+I9iSKgokKSt5Pze/Q8JTKxe0AToPc41YGBIN9Lt0gslXI8TGM3x36dooSRmOpfayfzcn0pQx9WYLKNR9PSs31nQ4OtEymYYR5wE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706290445; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=q/lRu96lP+9hig2DfITdw70Fa08pfxR/d1NeEVgyLNY=; b=JyfjLe2JNF4gPBIBbnWsYMNccXoilCIVP/+GTyriSOyX16BWZNhBxScUZJHb13P6/I3XgFrFJZI1tYTtrPFWzOr0srQ5LjolGvU1ZUu/NwGaEH+qlQUYyobw7N0CfJlq6xlSEkdBDOFVO8/oGs77CgM8eVudd5XbPEuvtggqIZo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706290445016107.9956520656657; Fri, 26 Jan 2024 09:34:05 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.672259.1046101 (Exim 4.92) (envelope-from ) id 1rTQ4l-00069V-MB; Fri, 26 Jan 2024 17:33:11 +0000 Received: by outflank-mailman (output) from mailman id 672259.1046101; Fri, 26 Jan 2024 17:33:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rTQ4l-00067l-HB; Fri, 26 Jan 2024 17:33:11 +0000 Received: by outflank-mailman (input) for mailman id 672259; Fri, 26 Jan 2024 17:33:09 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rTQ4j-0004m7-62 for xen-devel@lists.xenproject.org; Fri, 26 Jan 2024 17:33:09 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f6ec2bc1-bc70-11ee-98f5-efadbce2ee36; Fri, 26 Jan 2024 18:33:06 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ4A-0000000EKVC-0etO; Fri, 26 Jan 2024 17:32:35 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ4A-00000001eoT-3xMI; Fri, 26 Jan 2024 17:32:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: f6ec2bc1-bc70-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=q/lRu96lP+9hig2DfITdw70Fa08pfxR/d1NeEVgyLNY=; b=vj3nhF9bU1XNbBMdoBXROJ/CKp z6OGkwU/f2qLQkr5Kvl6koyxRd9PsNFD7P4tvwbtBVduPJTn29ufLl2gUvRSOcwEj5M1PAwCGRop5 TAWRbg1sb3eiBIKaWuv58DTiU5r64U+Pds1iLl+EEVlFa2HJM9Eato3sSBtkNtsNYU3wwmeim7LTb WcS5icwJl23aWJhXOzaJkjYZ5RidPs4FC4bKxLeij+a5tSXiGiJllO04RiIy9N0rlm5r5R5K5PO6m X9VWrPGjT/2HbFyzDdU4+Uny7bmEQTUVmH/xr8IH3sBmNjyi8Cw9hpmFUYVd6R/HAUvdgzFPb3SRV 4c0egt9A==; From: David Woodhouse To: qemu-devel@nongnu.org Cc: Richard Henderson , Beniamino Galvani , Peter Maydell , Strahinja Jankovic , Niek Linnenbank , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Andrew Jeffery , Joel Stanley , Igor Mitsyanko , Jean-Christophe Dubois , Andrey Smirnov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rob Herring , Subbaraya Sundeep , Jan Kiszka , Tyrone Ting , Hao Wu , Radoslaw Biernacki , Leif Lindholm , Marcin Juszkiewicz , "Edgar E. Iglesias" , Alistair Francis , Helge Deller , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Song Gao , Thomas Huth , Laurent Vivier , Huacai Chen , Jiaxun Yang , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aleksandar Rikalo , Aurelien Jarno , Jason Wang , Jia Liu , Stafford Horne , Mark Cave-Ayland , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Halil Pasic , Christian Borntraeger , Eric Farman , David Hildenbrand , Ilya Leoshkevich , Yoshinori Sato , Magnus Damm , Artyom Tarasenko , Stefano Stabellini , Anthony Perard , Paul Durrant , Max Filippov , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org, David Woodhouse , Thomas Huth Subject: [PATCH v4 45/47] hw/pci: remove pci_nic_init_nofail() Date: Fri, 26 Jan 2024 17:25:22 +0000 Message-ID: <20240126173228.394202-46-dwmw2@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126173228.394202-1-dwmw2@infradead.org> References: <20240126173228.394202-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1706290446934100001 Content-Type: text/plain; charset="utf-8" From: David Woodhouse This function is no longer used, as all its callers have been converted to use pci_init_nic_devices() instead. Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/pci/pci.c | 72 -------------------------------------------- include/hw/pci/pci.h | 3 -- 2 files changed, 75 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 5849606f66..449abfb182 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1853,78 +1853,6 @@ const pci_class_desc *get_class_desc(int class) return desc; } =20 -/* Initialize a PCI NIC. */ -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, - const char *default_model, - const char *default_devaddr) -{ - const char *devaddr =3D nd->devaddr ? nd->devaddr : default_devaddr; - GPtrArray *pci_nic_models; - PCIBus *bus; - PCIDevice *pci_dev; - DeviceState *dev; - int devfn; - int i; - int dom, busnr; - unsigned slot; - - if (nd->model && !strcmp(nd->model, "virtio")) { - g_free(nd->model); - nd->model =3D g_strdup("virtio-net-pci"); - } - - pci_nic_models =3D qemu_get_nic_models(TYPE_PCI_DEVICE); - - if (qemu_show_nic_models(nd->model, (const char **)pci_nic_models->pda= ta)) { - exit(0); - } - - i =3D qemu_find_nic_model(nd, (const char **)pci_nic_models->pdata, - default_model); - if (i < 0) { - exit(1); - } - - if (!rootbus) { - error_report("No primary PCI bus"); - exit(1); - } - - assert(!rootbus->parent_dev); - - if (!devaddr) { - devfn =3D -1; - busnr =3D 0; - } else { - if (pci_parse_devaddr(devaddr, &dom, &busnr, &slot, NULL) < 0) { - error_report("Invalid PCI device address %s for device %s", - devaddr, nd->model); - exit(1); - } - - if (dom !=3D 0) { - error_report("No support for non-zero PCI domains"); - exit(1); - } - - devfn =3D PCI_DEVFN(slot, 0); - } - - bus =3D pci_find_bus_nr(rootbus, busnr); - if (!bus) { - error_report("Invalid PCI device address %s for device %s", - devaddr, nd->model); - exit(1); - } - - pci_dev =3D pci_new(devfn, nd->model); - dev =3D &pci_dev->qdev; - qdev_set_nic_properties(dev, nd); - pci_realize_and_unref(pci_dev, bus, &error_fatal); - g_ptr_array_free(pci_nic_models, true); - return pci_dev; -} - void pci_init_nic_devices(PCIBus *bus, const char *default_model) { qemu_create_nic_bus_devices(&bus->qbus, TYPE_PCI_DEVICE, default_model, diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 6ff0b95a02..eaa3fc99d8 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -314,9 +314,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *de= v, PCIINTxRoutingNotifier notifier); void pci_device_reset(PCIDevice *dev); =20 -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, - const char *default_model, - const char *default_devaddr); void pci_init_nic_devices(PCIBus *bus, const char *default_model); bool pci_init_nic_in_slot(PCIBus *rootbus, const char *default_model, const char *alias, const char *devaddr); --=20 2.43.0