summaryrefslogtreecommitdiffstats
path: root/softmmu/vl.c
diff options
context:
space:
mode:
authorPaolo Bonzini2020-10-21 12:49:31 +0200
committerPaolo Bonzini2020-12-10 18:15:11 +0100
commit3df8c4f31a60101c61d7f49ce0a3635690bed579 (patch)
tree568bf40f3354244a5cac19b2202c2509a409fa08 /softmmu/vl.c
parenttreewide: do not use short-form boolean options (diff)
downloadqemu-3df8c4f31a60101c61d7f49ce0a3635690bed579.tar.gz
qemu-3df8c4f31a60101c61d7f49ce0a3635690bed579.tar.xz
qemu-3df8c4f31a60101c61d7f49ce0a3635690bed579.zip
vl: extract validation of -smp to machine.c
Once smp_parse is done, the validation operates on the MachineState. There is no reason for that code to be in vl.c. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu/vl.c')
-rw-r--r--softmmu/vl.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 3819a4abf2..69d54b27b9 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3976,24 +3976,8 @@ void qemu_init(int argc, char **argv, char **envp)
exit(0);
}
- machine_class->smp_parse(current_machine,
- qemu_opts_find(qemu_find_opts("smp-opts"), NULL));
-
- /* sanity-check smp_cpus and max_cpus against machine_class */
- if (current_machine->smp.cpus < machine_class->min_cpus) {
- error_report("Invalid SMP CPUs %d. The min CPUs "
- "supported by machine '%s' is %d",
- current_machine->smp.cpus,
- machine_class->name, machine_class->min_cpus);
- exit(1);
- }
- if (current_machine->smp.max_cpus > machine_class->max_cpus) {
- error_report("Invalid SMP CPUs %d. The max CPUs "
- "supported by machine '%s' is %d",
- current_machine->smp.max_cpus,
- machine_class->name, machine_class->max_cpus);
- exit(1);
- }
+ machine_smp_parse(current_machine,
+ qemu_opts_find(qemu_find_opts("smp-opts"), NULL), &error_fatal);
if (mem_prealloc) {
char *val;