[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/3] numa: Reject CPU indexes > max_cpus
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH v2 1/3] numa: Reject CPU indexes > max_cpus |
Date: |
Mon, 9 Feb 2015 17:53:14 -0200 |
The CPU indexes for NUMA nodes make sense only up to max_cpus, and CPU
indexes > max_cpus are ignored. Reject configuration which uses invalid
CPU indexes.
Signed-off-by: Eduardo Habkost <address@hidden>
---
numa.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/numa.c b/numa.c
index 0d15375..f768434 100644
--- a/numa.c
+++ b/numa.c
@@ -76,9 +76,10 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts
*opts, Error **errp)
}
for (cpus = node->cpus; cpus; cpus = cpus->next) {
- if (cpus->value > MAX_CPUMASK_BITS) {
- error_setg(errp, "CPU number %" PRIu16 " is bigger than %d",
- cpus->value, MAX_CPUMASK_BITS);
+ if (cpus->value > max_cpus) {
+ error_setg(errp,
+ "CPU number %" PRIu16 " is bigger than maxcpus (%d)",
+ cpus->value, max_cpus);
return;
}
bitmap_set(numa_info[nodenr].node_cpu, cpus->value, 1);
--
2.1.0