aboutsummaryrefslogtreecommitdiff
path: root/hw/core/numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/numa.c')
-rw-r--r--hw/core/numa.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 66119d181b..a11431483c 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -31,6 +31,7 @@
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi/qapi-visit-machine.h"
+#include "sysemu/qtest.h"
#include "hw/mem/pc-dimm.h"
#include "hw/mem/memory-device.h"
#include "qemu/option.h"
@@ -44,7 +45,8 @@ QemuOptsList qemu_numa_opts = {
.desc = { { 0 } } /* validated with OptsVisitor */
};
-static int have_memdevs = -1;
+static int have_memdevs;
+static int have_mem;
static int max_numa_nodeid; /* Highest specified NUMA node ID, plus one.
* For all nodes, nodeid < max_numa_nodeid
*/
@@ -60,6 +62,7 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
uint16_t nodenr;
uint16List *cpus = NULL;
MachineClass *mc = MACHINE_GET_CLASS(ms);
+ unsigned int max_cpus = ms->smp.max_cpus;
if (node->has_nodeid) {
nodenr = node->nodeid;
@@ -101,22 +104,20 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
}
}
- if (node->has_mem && node->has_memdev) {
- error_setg(errp, "cannot specify both mem= and memdev=");
- return;
- }
-
- if (have_memdevs == -1) {
- have_memdevs = node->has_memdev;
- }
- if (node->has_memdev != have_memdevs) {
- error_setg(errp, "memdev option must be specified for either "
- "all or no nodes");
+ have_memdevs = have_memdevs ? : node->has_memdev;
+ have_mem = have_mem ? : node->has_mem;
+ if ((node->has_mem && have_memdevs) || (node->has_memdev && have_mem)) {
+ error_setg(errp, "numa configuration should use either mem= or memdev=,"
+ "mixing both is not allowed");
return;
}
if (node->has_mem) {
numa_info[nodenr].node_mem = node->mem;
+ if (!qtest_enabled()) {
+ warn_report("Parameter -numa node,mem is deprecated,"
+ " use -numa node,memdev instead");
+ }
}
if (node->has_memdev) {
Object *o;
@@ -402,6 +403,11 @@ void numa_complete_configuration(MachineState *ms)
if (i == nb_numa_nodes) {
assert(mc->numa_auto_assign_ram);
mc->numa_auto_assign_ram(mc, numa_info, nb_numa_nodes, ram_size);
+ if (!qtest_enabled()) {
+ warn_report("Default splitting of RAM between nodes is deprecated,"
+ " Use '-numa node,memdev' to explictly define RAM"
+ " allocation per node");
+ }
}
numa_total = 0;
@@ -473,8 +479,10 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
if (mem_prealloc) {
exit(1);
}
- error_report("falling back to regular RAM allocation.");
-
+ warn_report("falling back to regular RAM allocation");
+ error_printf("This is deprecated. Make sure that -mem-path "
+ " specified path has sufficient resources to allocate"
+ " -m specified RAM amount");
/* Legacy behavior: if allocation failed, fall back to
* regular RAM allocation.
*/