diff options
author | Igor Mammedov <imammedo@redhat.com> | 2017-05-30 18:23:57 +0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2017-06-05 14:59:08 -0300 |
commit | 60bed6a30aa8341cbc8fae4bdc53b9eb99d80586 (patch) | |
tree | 9c68893c9b97f73a99d58e92a5432f9587f4f75d /numa.c | |
parent | a0ceb640d083ab583d115fbd2ded14c089044ae8 (diff) |
numa: move default mapping init to machine
there is no need use cpu_index_to_instance_props() for setting
default cpu -> node mapping. Generic machine code can do it
without cpu_index by just enabling already preset defaults
in possible_cpus.
PS:
as bonus it makes one less user of cpu_index_to_instance_props()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1496161442-96665-3-git-send-email-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'numa.c')
-rw-r--r-- | numa.c | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -426,7 +426,6 @@ void numa_default_auto_assign_ram(MachineClass *mc, NodeInfo *nodes, void parse_numa_opts(MachineState *ms) { int i; - const CPUArchIdList *possible_cpus; MachineClass *mc = MACHINE_GET_CLASS(ms); if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, NULL)) { @@ -484,31 +483,6 @@ void parse_numa_opts(MachineState *ms) numa_set_mem_ranges(); - /* assign CPUs to nodes using board provided default mapping */ - if (!mc->cpu_index_to_instance_props || !mc->possible_cpu_arch_ids) { - error_report("default CPUs to NUMA node mapping isn't supported"); - exit(1); - } - - possible_cpus = mc->possible_cpu_arch_ids(ms); - for (i = 0; i < possible_cpus->len; i++) { - if (possible_cpus->cpus[i].props.has_node_id) { - break; - } - } - - /* no CPUs are assigned to NUMA nodes */ - if (i == possible_cpus->len) { - for (i = 0; i < max_cpus; i++) { - CpuInstanceProperties props; - /* fetch default mapping from board and enable it */ - props = mc->cpu_index_to_instance_props(ms, i); - props.has_node_id = true; - - machine_set_cpu_numa_node(ms, &props, &error_fatal); - } - } - /* QEMU needs at least all unique node pair distances to build * the whole NUMA distance table. QEMU treats the distance table * as symmetric by default, i.e. distance A->B == distance B->A. |