summaryrefslogtreecommitdiffstats
path: root/numa.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-03-02 12:13:45 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-02 12:13:45 +0000
commit2dffe5516e74215fadf2e0f5ee401db4d5a86f7a (patch)
tree9b7d3cf4b2745e7ad5380cb64d3e90c8d7948bba /numa.c
parent041ccc922ee474693a2869d4e3b59e920c739bc0 (diff)
parentdde11116782c1891a057165539efc014cf365026 (diff)
downloadhqemu-2dffe5516e74215fadf2e0f5ee401db4d5a86f7a.zip
hqemu-2dffe5516e74215fadf2e0f5ee401db4d5a86f7a.tar.gz
Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging
NUMA fixes queue # gpg: Signature made Mon Feb 23 19:28:42 2015 GMT using RSA key ID 984DC5A6 # gpg: Can't check signature: public key not found * remotes/ehabkost/tags/numa-pull-request: numa: Rename set_numa_modes() to numa_post_machine_init() numa: Rename option parsing functions numa: Move QemuOpts parsing to set_numa_nodes() numa: Make max_numa_nodeid static numa: Move NUMA globals to numa.c vl.c: Remove unnecessary zero-initialization of NUMA globals numa: Move NUMA declarations from sysemu.h to numa.h Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'numa.c')
-rw-r--r--numa.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/numa.c b/numa.c
index f8fc377..5634bf0 100644
--- a/numa.c
+++ b/numa.c
@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
-#include "sysemu/sysemu.h"
+#include "sysemu/numa.h"
#include "exec/cpu-common.h"
#include "qemu/bitmap.h"
#include "qom/cpu.h"
@@ -36,6 +36,8 @@
#include "sysemu/hostmem.h"
#include "qmp-commands.h"
#include "hw/mem/pc-dimm.h"
+#include "qemu/option.h"
+#include "qemu/config-file.h"
QemuOptsList qemu_numa_opts = {
.name = "numa",
@@ -45,6 +47,11 @@ QemuOptsList qemu_numa_opts = {
};
static int have_memdevs = -1;
+static int max_numa_nodeid; /* Highest specified NUMA node ID, plus one.
+ * For all nodes, nodeid < max_numa_nodeid
+ */
+int nb_numa_nodes;
+NodeInfo numa_info[MAX_NODES];
static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp)
{
@@ -116,7 +123,7 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp)
max_numa_nodeid = MAX(max_numa_nodeid, nodenr + 1);
}
-int numa_init_func(QemuOpts *opts, void *opaque)
+static int parse_numa(QemuOpts *opts, void *opaque)
{
NumaOptions *object = NULL;
Error *err = NULL;
@@ -158,10 +165,15 @@ error:
return -1;
}
-void set_numa_nodes(void)
+void parse_numa_opts(void)
{
int i;
+ if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa,
+ NULL, 1) != 0) {
+ exit(1);
+ }
+
assert(max_numa_nodeid <= MAX_NODES);
/* No support for sparse NUMA node IDs yet: */
@@ -233,7 +245,7 @@ void set_numa_nodes(void)
}
}
-void set_numa_modes(void)
+void numa_post_machine_init(void)
{
CPUState *cpu;
int i;
OpenPOWER on IntegriCloud