aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/prep.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-05-12 14:40:20 +0200
committerThomas Huth <thuth@redhat.com>2023-05-22 09:44:22 +0200
commit053b7086274487c31a136940c75a665211bc2b4a (patch)
tree8b14ae9f728a6abef32905d419bbdb6d3e195c45 /hw/ppc/prep.c
parent26a0802d1ccbf3c3c659f3d2641cf7deef0e70ac (diff)
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 <pbonzini@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw/ppc/prep.c')
-rw-r--r--hw/ppc/prep.c4
1 files changed, 3 insertions, 1 deletions
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)