numa: properly check if numa is supported
Commitaa57020774
, by mistake used MachineClass::numa_mem_supported to check if NUMA is supported by machine and also as unrelated change set it to true for sbsa-ref board. Luckily change didn't break machines that support NUMA, as the field is set to true for them. But the field is not intended for checking if NUMA is supported and will be flipped to false within this release for new machine types. Fix it: - by using previously used condition !mc->cpu_index_to_instance_props || !mc->get_default_cpu_node_id the first time and then use MachineState::numa_state down the road to check if NUMA is supported - dropping stray sbsa-ref chunk Fixes:aa57020774
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1576154936-178362-3-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
5275db59aa
commit
fcd3f2cc12
|
@ -789,7 +789,6 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data)
|
||||||
mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids;
|
mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids;
|
||||||
mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props;
|
mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props;
|
||||||
mc->get_default_cpu_node_id = sbsa_ref_get_default_cpu_node_id;
|
mc->get_default_cpu_node_id = sbsa_ref_get_default_cpu_node_id;
|
||||||
mc->numa_mem_supported = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo sbsa_ref_info = {
|
static const TypeInfo sbsa_ref_info = {
|
||||||
|
|
|
@ -963,7 +963,7 @@ static void machine_initfn(Object *obj)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mc->numa_mem_supported) {
|
if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) {
|
||||||
ms->numa_state = g_new0(NumaState, 1);
|
ms->numa_state = g_new0(NumaState, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1107,7 +1107,7 @@ void machine_run_board_init(MachineState *machine)
|
||||||
{
|
{
|
||||||
MachineClass *machine_class = MACHINE_GET_CLASS(machine);
|
MachineClass *machine_class = MACHINE_GET_CLASS(machine);
|
||||||
|
|
||||||
if (machine_class->numa_mem_supported) {
|
if (machine->numa_state) {
|
||||||
numa_complete_configuration(machine);
|
numa_complete_configuration(machine);
|
||||||
if (machine->numa_state->num_nodes) {
|
if (machine->numa_state->num_nodes) {
|
||||||
machine_numa_finish_cpu_init(machine);
|
machine_numa_finish_cpu_init(machine);
|
||||||
|
|
Loading…
Reference in a new issue