@@ -1689,6 +1689,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pcmc->get_hotplug_handler = mc->get_hotplug_handler;
mc->get_hotplug_handler = pc_get_hotpug_handler;
mc->default_boot_order = "cad";
+ mc->hot_add_cpu = pc_hot_add_cpu;
+ mc->max_cpus = 255;
hc->plug = pc_machine_device_plug_cb;
}
@@ -454,7 +454,6 @@ static void pc_xen_hvm_init(MachineState *machine)
static void pc_i440fx_machine_options(MachineClass *mc)
{
- pc_default_machine_options(mc);
mc->desc = "Standard PC (i440FX + PIIX, 1996)";
mc->hot_add_cpu = pc_hot_add_cpu;
}
@@ -1017,6 +1016,7 @@ static void isapc_machine_class_init(ObjectClass *oc, void *data)
mc->desc = "ISA-only PC";
mc->init = pc_init_isa;
mc->max_cpus = 1;
+ mc->hot_add_cpu = NULL;
mc->name = "isapc";
machine_class_add_compat_props(mc, compat_props);
}
@@ -343,7 +343,6 @@ static void pc_q35_init_1_4(MachineState *machine)
static void pc_q35_machine_options(MachineClass *mc)
{
- pc_default_machine_options(mc);
mc->desc = "Standard PC (Q35 + ICH9, 2009)";
mc->hot_add_cpu = pc_hot_add_cpu;
}
@@ -506,10 +506,4 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
.value = stringify(0),\
}
-static inline void pc_default_machine_options(MachineClass *mc)
-{
- mc->hot_add_cpu = pc_hot_add_cpu;
- mc->max_cpus = 255;
-}
-
#endif
The only PC machines that didn't call pc_default_machine_options() were isaps and xenfv. Both were already overwriting max_cpus, and only isapc was not overwriting hot_add_cpu. After making isapc set hot_add_cpu to NULL, we can move the pc_default_machine_options() code the PC common class_init. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- hw/i386/pc.c | 2 ++ hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 1 - include/hw/i386/pc.h | 6 ------ 4 files changed, 3 insertions(+), 8 deletions(-)