From 053b7086274487c31a136940c75a665211bc2b4a Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 12 May 2023 14:40:20 +0200 Subject: hw/ppc: Use MachineClass->default_nic in the ppc machines Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Message-Id: <20230512124033.502654-6-thuth@redhat.com> Acked-by: Paolo Bonzini Signed-off-by: Thomas Huth --- hw/ppc/prep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/ppc/prep.c') diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index d00280c0f8..4610abddbd 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -229,6 +229,7 @@ static int prep_set_cmos_checksum(DeviceState *dev, void *opaque) static void ibm_40p_init(MachineState *machine) { const char *bios_name = machine->firmware ?: "openbios-ppc"; + MachineClass *mc = MACHINE_GET_CLASS(machine); CPUPPCState *env = NULL; uint16_t cmos_checksum; PowerPCCPU *cpu; @@ -323,7 +324,7 @@ static void ibm_40p_init(MachineState *machine) pci_vga_init(pci_bus); for (i = 0; i < nb_nics; i++) { - pci_nic_init_nofail(&nd_table[i], pci_bus, "pcnet", + pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, i == 0 ? "3" : NULL); } } @@ -427,6 +428,7 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->default_boot_order = "c"; mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("604"); mc->default_display = "std"; + mc->default_nic = "pcnet"; } DEFINE_MACHINE("40p", ibm_40p_machine_init) -- cgit v1.2.3