From 1af878e0497a885b6cbdd3a6d91d399f4851d99c Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Thu, 26 Jun 2014 18:33:18 -0300 Subject: numa: Keep track of NUMA nodes present on the command-line Based on "enable sparse node numbering" patch from Nishanth Aravamudan, but without the code to actually support sparse node IDs. This just adds the code to keep track of present/non-present nodes on the command-line, without changing any behavior. Signed-off-by: Nishanth Aravamudan [Rename max_numa_node to max_numa_nodeid -Eduardo] [Initialize max_numa_nodeid to 0 -Eduardo] [Use MAX() macro when setting max_numa_nodeid -Eduardo] Signed-off-by: Eduardo Habkost Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Hu Tao Reviewed-by: Eric Blake --- include/sysemu/sysemu.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/sysemu') diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 285c45b..d8539fd 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -146,11 +146,16 @@ extern int mem_prealloc; */ #define MAX_CPUMASK_BITS 255 -extern int nb_numa_nodes; +extern int nb_numa_nodes; /* Number of NUMA nodes */ +extern int max_numa_nodeid; /* Highest specified NUMA node ID, plus one. + * For all nodes, nodeid < max_numa_nodeid + */ + typedef struct node_info { uint64_t node_mem; DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS); struct HostMemoryBackend *node_memdev; + bool present; } NodeInfo; extern NodeInfo numa_info[MAX_NODES]; void set_numa_nodes(void); -- cgit v1.1