[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v5 42/43] numa: allow memory-less nodes when using me
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL v5 42/43] numa: allow memory-less nodes when using memdev as backend |
Date: |
Wed, 3 Jul 2019 18:08:20 -0300 |
From: Igor Mammedov <address@hidden>
QEMU fails to start if memory-less node is present when memdev
is used
qemu-system-x86_64 -object memory-backend-ram,id=ram0,size=128M \
-numa node -numa node,memdev=ram0
with error:
"memdev option must be specified for either all or no nodes"
which works as expected if legacy 'mem' is used.
Fix check to make memory-less nodes valid when memdev option is used
but still disallow mix of mem and memdev options.
Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/core/numa.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index fa52f59e86..b766e38854 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -45,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
*/
@@ -103,17 +104,11 @@ 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;
}
--
2.18.0.rc1.1.g3f1ff2140
- [Qemu-devel] [PULL v5 24/43] i386: make 'hv-spinlocks' a regular uint32 property, (continued)
- [Qemu-devel] [PULL v5 24/43] i386: make 'hv-spinlocks' a regular uint32 property, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 23/43] i386: Fix signedness of hyperv_spinlock_attempts, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 26/43] i386: Remove unused host_cpudef variable, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 27/43] target/i386: Add CPUID.1F generation support for multi-dies PCMachine, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 12/43] hw/i386: Adjust nr_dies with configured smp_dies for PCMachine, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 29/43] vl.c: Add -smp, dies=* command line support and update doc, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 28/43] machine: Refactor smp_parse() in vl.c as MachineClass::smp_parse(), Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 30/43] qmp: Add deprecation information to query-machines, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 31/43] i386: Introduce SnowRidge CPU model, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 32/43] qmp: Add "alias-of" field to query-cpu-definitions, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 42/43] numa: allow memory-less nodes when using memdev as backend,
Eduardo Habkost <=
- [Qemu-devel] [PULL v5 33/43] i386: Add x-force-features option for testing, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 17/43] numa: deprecate 'mem' parameter of '-numa node' option, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 39/43] docs: Deprecate CPU model runnability guarantees, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 38/43] i386: Make unversioned CPU models be aliases, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 35/43] i386: Register versioned CPU models, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 43/43] tests: use -numa memdev option in tests instead of legacy 'mem' option, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 37/43] i386: Replace -noTSX, -IBRS, -IBPB CPU models with aliases, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 36/43] i386: Define -IBRS, -noTSX, -IBRS versions of CPU models, Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 34/43] i386: Get model-id from CPU object on "-cpu help", Eduardo Habkost, 2019/07/03
- [Qemu-devel] [PULL v5 41/43] numa: Make deprecation warnings conditional on !qtest_enabled(), Eduardo Habkost, 2019/07/03