qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Strahinja Jankovic" <strahinja.p.jankovic@gmail.com>,
	"Niek Linnenbank" <nieklinnenbank@gmail.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Joel Stanley" <joel@jms.id.au>,
	"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	"Andrey Smirnov" <andrew.smirnov@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Rob Herring" <robh@kernel.org>,
	"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
	"Jan Kiszka" <jan.kiszka@web.de>,
	"Tyrone Ting" <kfting@nuvoton.com>,
	"Hao Wu" <wuhaotsh@google.com>,
	"Radoslaw Biernacki" <rad@semihalf.com>,
	"Leif Lindholm" <quic_llindhol@quicinc.com>,
	"Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Helge Deller" <deller@gmx.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Song Gao" <gaosong@loongson.cn>,
	"Thomas Huth" <huth@tuxfamily.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Jason Wang" <jasowang@redhat.com>, "Jia Liu" <proljc@gmail.com>,
	"Stafford Horne" <shorne@gmail.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Yoshinori Sato" <ysato@users.sourceforge.jp>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Paul Durrant" <paul@xen.org>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org,
	qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org,
	"David Woodhouse" <dwmw@amazon.co.uk>
Subject: [PATCH v3 44/46] hw/pci: remove pci_nic_init_nofail()
Date: Mon,  8 Jan 2024 20:27:13 +0000	[thread overview]
Message-ID: <20240108204909.564514-45-dwmw2@infradead.org> (raw)
In-Reply-To: <20240108204909.564514-1-dwmw2@infradead.org>

From: David Woodhouse <dwmw@amazon.co.uk>

This function is no longer used.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 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;
 }
 
-/* Initialize a PCI NIC.  */
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr)
-{
-    const char *devaddr = 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 = g_strdup("virtio-net-pci");
-    }
-
-    pci_nic_models = qemu_get_nic_models(TYPE_PCI_DEVICE);
-
-    if (qemu_show_nic_models(nd->model, (const char **)pci_nic_models->pdata)) {
-        exit(0);
-    }
-
-    i = 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 = -1;
-        busnr = 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 != 0) {
-            error_report("No support for non-zero PCI domains");
-            exit(1);
-        }
-
-        devfn = PCI_DEVFN(slot, 0);
-    }
-
-    bus = 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 = pci_new(devfn, nd->model);
-    dev = &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 *dev,
                                           PCIINTxRoutingNotifier notifier);
 void pci_device_reset(PCIDevice *dev);
 
-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);
-- 
2.41.0



  parent reply	other threads:[~2024-01-08 21:00 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-08 20:26 [PATCH v3 00/46] Rework matching of network devices to -nic options David Woodhouse
2024-01-08 20:26 ` [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info() David Woodhouse
2024-01-26 11:10   ` Thomas Huth
2024-01-26 14:16     ` David Woodhouse
2024-01-26 14:24       ` Thomas Huth
2024-01-26 14:34         ` David Woodhouse
2024-01-26 14:39           ` Thomas Huth
2024-01-26 14:43   ` Peter Maydell
2024-01-26 15:19     ` [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info() David Woodhouse
2024-01-26 15:33       ` [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info() Peter Maydell
2024-01-26 15:43         ` [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info() David Woodhouse
2024-01-08 20:26 ` [PATCH v3 02/46] net: report list of available models according to platform David Woodhouse
2024-01-26 14:33   ` Thomas Huth
2024-01-26 14:46     ` David Woodhouse
2024-01-26 14:50       ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 03/46] net: add qemu_create_nic_bus_devices() David Woodhouse
2024-01-26 14:41   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 04/46] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot() David Woodhouse
2024-01-08 20:26 ` [PATCH v3 05/46] hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices() David Woodhouse
2024-01-26 10:43   ` Thomas Huth
2024-01-26 11:13     ` David Woodhouse
2024-01-26 11:20       ` Thomas Huth
2024-01-26 11:25         ` David Woodhouse
2024-01-26 13:45           ` Thomas Huth
2024-01-26 13:56             ` David Woodhouse
2024-01-08 20:26 ` [PATCH v3 06/46] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs David Woodhouse
2024-01-08 20:26 ` [PATCH v3 07/46] hw/alpha/dp264: use pci_init_nic_devices() David Woodhouse
2024-01-26 15:28   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 08/46] hw/arm/sbsa-ref: " David Woodhouse
2024-01-08 20:26 ` [PATCH v3 09/46] hw/arm/virt: " David Woodhouse
2024-01-26 15:30   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 10/46] hw/hppa: " David Woodhouse
2024-01-26 15:38   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 11/46] hw/loongarch: " David Woodhouse
2024-01-09  1:50   ` gaosong
2024-01-08 20:26 ` [PATCH v3 12/46] hw/mips/fuloong2e: " David Woodhouse
2024-01-26 13:53   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 13/46] hw/mips/malta: " David Woodhouse
2024-01-26 13:57   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 14/46] hw/mips/loongson3_virt: " David Woodhouse
2024-01-26 13:58   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 15/46] hw/ppc/prep: " David Woodhouse
2024-01-26 14:06   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 16/46] hw/ppc/spapr: use qemu_get_nic_info() and pci_init_nic_devices() David Woodhouse
2024-01-26 14:09   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 17/46] hw/ppc: use pci_init_nic_devices() David Woodhouse
2024-01-26 14:14   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 18/46] hw/sh4/r2d: " David Woodhouse
2024-01-08 20:26 ` [PATCH v3 19/46] hw/sparc64/sun4u: " David Woodhouse
2024-01-26 14:21   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 20/46] hw/xtensa/virt: " David Woodhouse
2024-01-26 14:47   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 21/46] hw/arm/allwinner: use qemu_configure_nic_device() David Woodhouse
2024-01-26 14:58   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 22/46] hw/arm/aspeed: " David Woodhouse
2024-01-16 13:32   ` Cédric Le Goater
2024-01-08 20:26 ` [PATCH v3 23/46] hw/arm/exynos4: use qemu_create_nic_device() David Woodhouse
2024-01-26 15:01   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 24/46] hw/arm/fsl: use qemu_configure_nic_device() David Woodhouse
2024-01-26 15:03   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 25/46] hw/net/smc91c111: " David Woodhouse
2024-01-26 15:14   ` Thomas Huth
2024-01-26 15:37     ` David Woodhouse
2024-01-08 20:26 ` [PATCH v3 26/46] hw/net/lan9118: " David Woodhouse
2024-01-08 20:26 ` [PATCH v3 27/46] hw/arm/highbank: use qemu_create_nic_device() David Woodhouse
2024-01-26 15:48   ` Thomas Huth
2024-01-08 20:26 ` [PATCH v3 28/46] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases David Woodhouse
2024-01-08 20:26 ` [PATCH v3 29/46] hw/arm/stellaris: use qemu_find_nic_info() David Woodhouse
2024-01-08 20:26 ` [PATCH v3 30/46] hw/arm: use qemu_configure_nic_device() David Woodhouse
2024-01-08 20:27 ` [PATCH v3 31/46] hw/net/etraxfs-eth: " David Woodhouse
2024-01-26 16:23   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 32/46] hw/m68k/mcf5208: use qemu_create_nic_device() David Woodhouse
2024-01-26 15:51   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 33/46] hw/m68k/q800: use qemu_find_nic_info() David Woodhouse
2024-01-08 20:27 ` [PATCH v3 34/46] hw/microblaze: use qemu_configure_nic_device() David Woodhouse
2024-01-26 15:57   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 35/46] hw/mips/mipssim: use qemu_create_nic_device() David Woodhouse
2024-01-26 16:20   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 36/46] hw/mips/jazz: use qemu_find_nic_info() David Woodhouse
2024-01-26 16:29   ` Thomas Huth
2024-01-26 16:38     ` David Woodhouse
2024-01-08 20:27 ` [PATCH v3 37/46] hw/net/lasi_i82596: use qemu_configure_nic_device() David Woodhouse
2024-01-26 16:30   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 38/46] hw/openrisc/openrisc_sim: use qemu_create_nic_device() David Woodhouse
2024-01-26 16:34   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 39/46] hw/riscv: use qemu_configure_nic_device() David Woodhouse
2024-01-26 16:36   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 40/46] hw/s390x/s390-virtio-ccw: use qemu_create_nic_device() David Woodhouse
2024-01-16 13:26   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 41/46] hw/sparc/sun4m: use qemu_find_nic_info() David Woodhouse
2024-01-08 20:27 ` [PATCH v3 42/46] hw/xtensa/xtfpga: use qemu_create_nic_device() David Woodhouse
2024-01-26 16:43   ` Thomas Huth
2024-01-08 20:27 ` [PATCH v3 43/46] net: remove qemu_check_nic_model() David Woodhouse
2024-01-26 16:01   ` Thomas Huth
2024-01-08 20:27 ` David Woodhouse [this message]
2024-01-26 16:03   ` [PATCH v3 44/46] hw/pci: remove pci_nic_init_nofail() Thomas Huth
2024-01-08 20:27 ` [PATCH v3 45/46] net: remove qemu_show_nic_models(), qemu_find_nic_model() David Woodhouse
2024-01-26 16:49   ` Thomas Huth
2024-01-26 16:54     ` David Woodhouse
2024-01-08 20:27 ` [PATCH v3 46/46] net: make nb_nics and nd_table[] static in net/net.c David Woodhouse
2024-01-26 16:08   ` Thomas Huth
2024-01-24 13:13 ` [PATCH v3 00/46] Rework matching of network devices to -nic options David Woodhouse
2024-01-25  0:38   ` Jason Wang
2024-01-26 16:51     ` Thomas Huth
2024-01-28 12:37       ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240108204909.564514-45-dwmw2@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=alistair@alistair23.me \
    --cc=andrew.smirnov@gmail.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=anthony.perard@citrix.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=b.galvani@gmail.com \
    --cc=bin.meng@windriver.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=chenhuacai@kernel.org \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=dwmw@amazon.co.uk \
    --cc=edgar.iglesias@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=farman@linux.ibm.com \
    --cc=gaosong@loongson.cn \
    --cc=harshpb@linux.ibm.com \
    --cc=hpoussin@reactos.org \
    --cc=huth@tuxfamily.org \
    --cc=i.mitsyanko@gmail.com \
    --cc=iii@linux.ibm.com \
    --cc=jan.kiszka@web.de \
    --cc=jasowang@redhat.com \
    --cc=jcd@tribudubois.net \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=joel@jms.id.au \
    --cc=kfting@nuvoton.com \
    --cc=laurent@vivier.eu \
    --cc=liwei1518@gmail.com \
    --cc=magnus.damm@gmail.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=marcin.juszkiewicz@linaro.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=nieklinnenbank@gmail.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=pasic@linux.ibm.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=proljc@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=quic_llindhol@quicinc.com \
    --cc=rad@semihalf.com \
    --cc=richard.henderson@linaro.org \
    --cc=robh@kernel.org \
    --cc=shorne@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=strahinja.p.jankovic@gmail.com \
    --cc=sundeep.lkml@gmail.com \
    --cc=wuhaotsh@google.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=ysato@users.sourceforge.jp \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).