On 08/01/2024 21.26, David Woodhouse wrote:
From: David Woodhouse <dwmw@amazon.co.uk>
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@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
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.