[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-8.3 v2 04/46] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot()
- To: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx
- From: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
- Date: Fri, 10 Nov 2023 09:21:14 +0000
- Cc: Richard Henderson <richard.henderson@xxxxxxxxxx>, Beniamino Galvani <b.galvani@xxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Strahinja Jankovic <strahinja.p.jankovic@xxxxxxxxx>, Niek Linnenbank <nieklinnenbank@xxxxxxxxx>, Cédric Le Goater <clg@xxxxxxxx>, Andrew Jeffery <andrew@xxxxxxxxxxxxxxxxxxxx>, Joel Stanley <joel@xxxxxxxxx>, Igor Mitsyanko <i.mitsyanko@xxxxxxxxx>, Jean-Christophe Dubois <jcd@xxxxxxxxxxxxxxx>, Andrey Smirnov <andrew.smirnov@xxxxxxxxx>, Rob Herring <robh@xxxxxxxxxx>, Subbaraya Sundeep <sundeep.lkml@xxxxxxxxx>, Jan Kiszka <jan.kiszka@xxxxxx>, Tyrone Ting <kfting@xxxxxxxxxxx>, Hao Wu <wuhaotsh@xxxxxxxxxx>, Radoslaw Biernacki <rad@xxxxxxxxxxxx>, Leif Lindholm <quic_llindhol@xxxxxxxxxxx>, Marcin Juszkiewicz <marcin.juszkiewicz@xxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, Helge Deller <deller@xxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Song Gao <gaosong@xxxxxxxxxxx>, Thomas Huth <huth@xxxxxxxxxxxxx>, Laurent Vivier <laurent@xxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, Jia Liu <proljc@xxxxxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Daniel Henrique Barboza <danielhb413@xxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, Harsh Prateek Bora <harshpb@xxxxxxxxxxxxx>, Bin Meng <bin.meng@xxxxxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Weiwei Li <liweiwei@xxxxxxxxxxx>, Liu Zhiwei <zhiwei_liu@xxxxxxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Ilya Leoshkevich <iii@xxxxxxxxxxxxx>, Halil Pasic <pasic@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Eric Farman <farman@xxxxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Magnus Damm <magnus.damm@xxxxxxxxx>, Artyom Tarasenko <atar4qemu@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, qemu-arm@xxxxxxxxxx, qemu-ppc@xxxxxxxxxx, qemu-riscv@xxxxxxxxxx, qemu-s390x@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Fri, 10 Nov 2023 09:23:08 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, 2023-11-10 at 08:31 +0100, Philippe Mathieu-Daudé wrote:
>
> > + pci_dev = pci_new(devfn, model);
> > + qdev_set_nic_properties(&pci_dev->qdev, nd);
> > + pci_realize_and_unref(pci_dev, bus, &error_fatal);
>
> Could these functions be used with hotplug devices?
>
> If so we should propagate the error, not make it fatal.
Hm, not sure. Mostly, I'm trying not to change existing behaviour with
this series (except in carefully noted cases where the minutiæ of the
existing behaviour appear to be both unintended and unimportant, and it
would be unnecessarily complex to preserve the gratuitous differences
between the way that platforms have open-coded things).
I don't think it makes much sense *even* to use the new
qemu_configure_nic_device() with hotplug devices. The user might create
a *netdev* at startup, for later hotplug devices to use. But they
wouldn't use `-nic` for that, and any devices explicitly added through
hotplug will have an explicitly specified netdev, won't they?
I don't think we want to change that model and allow hotplug devices to
magically get config from -nic on the command line... do we?
We even have a warning for the case where NIC configurations are
provided with -nic but aren't consumed by the time the platform is
instantiated (although that doesn't *prevent* them from being used
later by hotplug).
But that's answering your question which was about "these functions".
For *this* particular function, pci_init_nic_in_slot(), it makes even
less sense to consider hotplug. This is for platforms to handle the
special cases, like "this board had an RTL8139 in slot 3", and make
that NIC appear in the appropriate slot. It's done as a special case
before processing the rest of the NICs which land in dynamically
assigned slots — which may even be on a *different* bus, in the case of
sun4u.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
|