[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RESEND v2 2/3] vl: fix max_cpus check
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH RESEND v2 2/3] vl: fix max_cpus check |
Date: |
Fri, 19 Dec 2014 00:59:46 -0200 |
From: Andrew Jones <address@hidden>
We should confirm max_cpus, which is >= smp_cpus, is
<= the machine's true max_cpus, not just smp_cpus.
Signed-off-by: Andrew Jones <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
vl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 3b7157d..cc4c535 100644
--- a/vl.c
+++ b/vl.c
@@ -3954,9 +3954,9 @@ int main(int argc, char **argv, char **envp)
smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL));
machine_class->max_cpus = machine_class->max_cpus ?: 1; /* Default to UP */
- if (smp_cpus > machine_class->max_cpus) {
+ if (max_cpus > machine_class->max_cpus) {
fprintf(stderr, "Number of SMP cpus requested (%d), exceeds max cpus "
- "supported by machine `%s' (%d)\n", smp_cpus,
+ "supported by machine `%s' (%d)\n", max_cpus,
machine_class->name, machine_class->max_cpus);
exit(1);
}
--
1.9.3