mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
numa: move numa global variable numa_info into MachineState
Move existing numa global numa_info (renamed as "nodes") into NumaState. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Tao Xu <tao3.xu@intel.com> Message-Id: <20190809065731.9097-5-tao3.xu@intel.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
118154b767
commit
7e721e7b10
11 changed files with 36 additions and 25 deletions
|
@ -359,8 +359,8 @@ static hwaddr spapr_node0_size(MachineState *machine)
|
|||
if (machine->numa_state->num_nodes) {
|
||||
int i;
|
||||
for (i = 0; i < machine->numa_state->num_nodes; ++i) {
|
||||
if (numa_info[i].node_mem) {
|
||||
return MIN(pow2floor(numa_info[i].node_mem),
|
||||
if (machine->numa_state->nodes[i].node_mem) {
|
||||
return MIN(pow2floor(machine->numa_state->nodes[i].node_mem),
|
||||
machine->ram_size);
|
||||
}
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ static int spapr_populate_memory(SpaprMachineState *spapr, void *fdt)
|
|||
MachineState *machine = MACHINE(spapr);
|
||||
hwaddr mem_start, node_size;
|
||||
int i, nb_nodes = machine->numa_state->num_nodes;
|
||||
NodeInfo *nodes = numa_info;
|
||||
NodeInfo *nodes = machine->numa_state->nodes;
|
||||
NodeInfo ramnode;
|
||||
|
||||
/* No NUMA nodes, assume there is just one node with whole RAM */
|
||||
|
@ -2541,11 +2541,11 @@ static void spapr_validate_node_memory(MachineState *machine, Error **errp)
|
|||
}
|
||||
|
||||
for (i = 0; i < machine->numa_state->num_nodes; i++) {
|
||||
if (numa_info[i].node_mem % SPAPR_MEMORY_BLOCK_SIZE) {
|
||||
if (machine->numa_state->nodes[i].node_mem % SPAPR_MEMORY_BLOCK_SIZE) {
|
||||
error_setg(errp,
|
||||
"Node %d memory size 0x%" PRIx64
|
||||
" is not aligned to %" PRIu64 " MiB",
|
||||
i, numa_info[i].node_mem,
|
||||
i, machine->numa_state->nodes[i].node_mem,
|
||||
SPAPR_MEMORY_BLOCK_SIZE / MiB);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue