aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/mac_newworld.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/mac_newworld.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/mac_newworld.c')
-rw-r--r--hw/ppc/mac_newworld.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 460c14b5e3..535710314a 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -132,6 +132,7 @@ static void ppc_core99_reset(void *opaque)
static void ppc_core99_init(MachineState *machine)
{
Core99MachineState *core99_machine = CORE99_MACHINE(machine);
+ MachineClass *mc = MACHINE_GET_CLASS(machine);
PowerPCCPU *cpu = NULL;
CPUPPCState *env = NULL;
char *filename;
@@ -444,7 +445,7 @@ static void ppc_core99_init(MachineState *machine)
}
for (i = 0; i < nb_nics; i++) {
- pci_nic_init_nofail(&nd_table[i], pci_bus, "sungem", NULL);
+ pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL);
}
/* The NewWorld NVRAM is not located in the MacIO device */
@@ -577,6 +578,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
mc->max_cpus = 1;
mc->default_boot_order = "cd";
mc->default_display = "std";
+ mc->default_nic = "sungem";
mc->kvm_type = core99_kvm_type;
#ifdef TARGET_PPC64
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("970fx_v3.1");