Il 07/03/2014 06:33, Hu Tao ha scritto:
On Tue, Mar 04, 2014 at 03:00:43PM +0100, Paolo Bonzini wrote:
This option provides the infrastructure for binding guest NUMA nodes
to host NUMA nodes. For example:
-object memory-ram,size=1024M,policy=membind,host-nodes=0,id=ram-node0 \
-numa node,nodeid=0,cpus=0,memdev=ram-node0 \
-object memory-ram,size=1024M,policy=interleave,host-nodes=1-3,id=ram-node1 \
-numa node,nodeid=1,cpus=1,memdev=ram-node1
The option replaces "-numa node,mem=".
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
include/sysemu/sysemu.h | 1 +
numa.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++--
qapi-schema.json | 8 ++++++-
qemu-options.hx | 12 ++++++----
4 files changed, 77 insertions(+), 7 deletions(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 54a6f28..4870129 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -139,6 +139,7 @@ extern int nb_numa_nodes;
typedef struct node_info {
uint64_t node_mem;
DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS);
+ struct HostMemoryBackend *node_memdev;
} NodeInfo;
extern NodeInfo numa_info[MAX_NODES];
void set_numa_nodes(void);
diff --git a/numa.c b/numa.c
index 930f49d..b00ef90 100644
--- a/numa.c
+++ b/numa.c
@@ -32,6 +32,7 @@
#include "qapi/dealloc-visitor.h"
#include "qapi/qmp/qerror.h"
#include "hw/boards.h"
+#include "sysemu/hostmem.h"
QemuOptsList qemu_numa_opts = {
.name = "numa",
@@ -40,6 +41,8 @@ QemuOptsList qemu_numa_opts = {
.desc = { { 0 } } /* validated with OptsVisitor */
};
+static int have_memdevs = -1;
+
bool?
It is three-state and "-1" means "I haven't seen -numa yet". Because of
the nodeid parameter you cannot change "have_memdevs == -1 to for
example "nodenr == 0".
Paolo