aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu/numa.h
diff options
context:
space:
mode:
authorTao Xu <tao3.xu@intel.com>2019-08-09 14:57:22 +0800
committerEduardo Habkost <ehabkost@redhat.com>2019-09-03 11:26:55 -0300
commitaa57020774b690a22be72453b8e91c9b5a68c516 (patch)
tree144a939fcca5737815d9134a45c44993ae36acce /include/sysemu/numa.h
parent2744ece8095b8cdb0d667654debc1d80dd57bbd3 (diff)
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>
Diffstat (limited to 'include/sysemu/numa.h')
-rw-r--r--include/sysemu/numa.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h
index 7a4ce89765..1786e861d0 100644
--- a/include/sysemu/numa.h
+++ b/include/sysemu/numa.h
@@ -14,7 +14,6 @@ struct CPUArchId;
#define NUMA_DISTANCE_MAX 254
#define NUMA_DISTANCE_UNREACHABLE 255
-extern int nb_numa_nodes; /* Number of NUMA nodes */
extern bool have_numa_distance;
struct NodeInfo {
@@ -31,10 +30,17 @@ struct NumaNodeMem {
extern NodeInfo numa_info[MAX_NODES];
+struct NumaState {
+ /* Number of NUMA nodes */
+ int num_nodes;
+
+};
+typedef struct NumaState NumaState;
+
void set_numa_options(MachineState *ms, NumaOptions *object, Error **errp);
void parse_numa_opts(MachineState *ms);
void numa_complete_configuration(MachineState *ms);
-void query_numa_node_mem(NumaNodeMem node_mem[]);
+void query_numa_node_mem(NumaNodeMem node_mem[], MachineState *ms);
extern QemuOptsList qemu_numa_opts;
void numa_legacy_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
int nb_nodes, ram_addr_t size);