mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
numa: move numa global variable nb_numa_nodes into MachineState
Add struct NumaState in MachineState and move existing numa global nb_numa_nodes(renamed as "num_nodes") into NumaState. And add variable numa_support into MachineClass to decide which submachines support NUMA. 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-3-tao3.xu@intel.com> [ehabkost: include hw/boards.h again to fix build failures] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
2744ece809
commit
aa57020774
17 changed files with 113 additions and 59 deletions
|
@ -203,6 +203,8 @@ static bool cpu_type_valid(const char *cpu)
|
|||
|
||||
static void create_fdt(VirtMachineState *vms)
|
||||
{
|
||||
MachineState *ms = MACHINE(vms);
|
||||
int nb_numa_nodes = ms->numa_state->num_nodes;
|
||||
void *fdt = create_device_tree(&vms->fdt_size);
|
||||
|
||||
if (!fdt) {
|
||||
|
@ -1846,7 +1848,7 @@ virt_cpu_index_to_props(MachineState *ms, unsigned cpu_index)
|
|||
|
||||
static int64_t virt_get_default_cpu_node_id(const MachineState *ms, int idx)
|
||||
{
|
||||
return idx % nb_numa_nodes;
|
||||
return idx % ms->numa_state->num_nodes;
|
||||
}
|
||||
|
||||
static const CPUArchIdList *virt_possible_cpu_arch_ids(MachineState *ms)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue