aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2014-12-19 00:59:46 -0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-01-09 23:41:12 +0100
commitc00cd99527d0d1b47a387239a7e3a8cf8ff82764 (patch)
tree5a8e98493bdfb3f9c481783811d5c9fb95faeb20 /vl.c
parent719cac1ce20c8806303793b2501aedb9edf1bca3 (diff)
vl: fix max_cpus check
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 <drjones@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 56a17ddc6b..95451b6af8 100644
--- a/vl.c
+++ b/vl.c
@@ -3850,9 +3850,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);
}