[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 05/46] hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices()
- To: Thomas Huth <thuth@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx
- From: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
- Date: Fri, 26 Jan 2024 11:13:18 +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>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, 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>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, 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 <liwei1518@xxxxxxxxx>, Liu Zhiwei <zhiwei_liu@xxxxxxxxxxxxxxxxx>, Halil Pasic <pasic@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Eric Farman <farman@xxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Ilya Leoshkevich <iii@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, 26 Jan 2024 11:14:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, 2024-01-26 at 11:43 +0100, Thomas Huth wrote:
> On 08/01/2024 21.26, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@xxxxxxxxxxxx>
> >
> > Eliminate direct access to nd_table[] and nb_nics by processing the the
> > Xen and ISA NICs first and then calling pci_init_nic_devices() for the
> > rest.
> >
> > Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
> > Reviewed-by: Paul Durrant <paul@xxxxxxx>
> > ---
> > hw/i386/pc.c | 26 ++++++++++++++++----------
> > include/hw/net/ne2000-isa.h | 2 --
> > 2 files changed, 16 insertions(+), 12 deletions(-)
> >
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 496498df3a..d80c536d88 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -658,8 +658,11 @@ static void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd)
> > {
> > static int nb_ne2k = 0;
> >
> > - if (nb_ne2k == NE2000_NB_MAX)
> > + if (nb_ne2k == NE2000_NB_MAX) {
> > + error_setg(&error_fatal,
> > + "maximum number of ISA NE2000 devices exceeded");
> > return;
> > + }
>
> error_setg(&error_fatal, ...) quits QEMU, so the "return;" does not make
> much sense anymore.
> Now, according to include/qapi/error.h :
>
> * Please don't error_setg(&error_fatal, ...), use error_report() and
> * exit(), because that's more obvious.
>
> So I'd suggest to do that instead.
It's going slightly in the opposite direction to what's requested in
https://lore.kernel.org/qemu-devel/34e2c0c6-4e04-486a-8e1f-4afdc461a5d4@xxxxxxxxxx/
I was thinking that a future patch would let the &error_fatal be an
Error** passed in by the caller, and not actually hard-coded to be
fatal at all.
But sure, unless Philippe objects I'm happy to do it as you show above.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
|