[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.10 09/23] numa: add check that board supports
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH for-2.10 09/23] numa: add check that board supports cpu_index to node mapping |
Date: |
Wed, 22 Mar 2017 14:32:34 +0100 |
Default node mapping initialization already checks that board
supports cpu_index to node mapping and refuses to start if
it's not supported. Do the same for explicitly provided
mapping "-numa node,cpus=..."
Signed-off-by: Igor Mammedov <address@hidden>
---
numa.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/numa.c b/numa.c
index b6e71bc..24c596d 100644
--- a/numa.c
+++ b/numa.c
@@ -140,10 +140,12 @@ uint32_t numa_get_node(ram_addr_t addr, Error **errp)
return -1;
}
-static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error
**errp)
+static void numa_node_parse(MachineState *ms, NumaNodeOptions *node,
+ QemuOpts *opts, Error **errp)
{
uint16_t nodenr;
uint16List *cpus = NULL;
+ MachineClass *mc = MACHINE_GET_CLASS(ms);
if (node->has_nodeid) {
nodenr = node->nodeid;
@@ -162,6 +164,10 @@ static void numa_node_parse(NumaNodeOptions *node,
QemuOpts *opts, Error **errp)
return;
}
+ if (!mc->cpu_index_to_instance_props) {
+ error_report("CPUs to NUMA node mapping isn't supported");
+ exit(1);
+ }
for (cpus = node->cpus; cpus; cpus = cpus->next) {
if (cpus->value >= max_cpus) {
error_setg(errp,
@@ -215,6 +221,7 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts
*opts, Error **errp)
static int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
{
NumaOptions *object = NULL;
+ MachineState *ms = opaque;
Error *err = NULL;
{
@@ -229,7 +236,7 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error
**errp)
switch (object->type) {
case NUMA_OPTIONS_TYPE_NODE:
- numa_node_parse(&object->u.node, opts, &err);
+ numa_node_parse(ms, &object->u.node, opts, &err);
if (err) {
goto end;
}
@@ -303,7 +310,7 @@ void parse_numa_opts(MachineState *ms)
numa_info[i].node_cpu = bitmap_new(max_cpus);
}
- if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, NULL, NULL)) {
+ if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, NULL)) {
exit(1);
}
--
2.7.4
- [Qemu-devel] [PATCH for-2.10 03/23] hw/arm/virt: use machine->possible_cpus for storing possible topology info, (continued)
- [Qemu-devel] [PATCH for-2.10 03/23] hw/arm/virt: use machine->possible_cpus for storing possible topology info, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 04/23] hw/arm/virt: explicitly allocate cpu_index for cpus, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 05/23] numa: move source of default CPUs to NUMA node mapping into boards, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 06/23] spapr: add node-id property to sPAPR core, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 07/23] pc: add node-id property to CPU, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 08/23] virt-arm: add node-id property to CPU, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 09/23] numa: add check that board supports cpu_index to node mapping,
Igor Mammedov <=
- [Qemu-devel] [PATCH for-2.10 10/23] numa: mirror cpu to node mapping in MachineState::possible_cpus, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 11/23] numa: do default mapping based on possible_cpus instead of node_cpu bitmaps, Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 12/23] pc: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu(), Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 13/23] spapr: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu(), Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 14/23] virt-arm: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu(), Igor Mammedov, 2017/03/22
- [Qemu-devel] [PATCH for-2.10 15/23] QMP: include CpuInstanceProperties into query_cpus output output, Igor Mammedov, 2017/03/22