mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
vl.c deprecate incorrect CPUs topology
-smp [cpus],sockets/cores/threads[,maxcpus] should describe topology so that total number of logical CPUs [sockets * cores * threads] would be equal to [maxcpus], however historically we didn't have such check in QEMU and it is possible to start VM with an invalid topology. Deprecate invalid options combination so we can make sure that the topology VM started with is always correct in the future. Users with an invalid sockets/cores/threads/maxcpus values should fix their CLI to make sure that [sockets * cores * threads] == [maxcpus] Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <1536836762-273036-2-git-send-email-imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [ehabkost: squashed unit test fix] Message-Id: <20181019215345.521d58d7@igors-macbook-pro.local> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
a1f3bb1845
commit
bc1fb850a3
3 changed files with 28 additions and 9 deletions
7
vl.c
7
vl.c
|
@ -1266,6 +1266,13 @@ static void smp_parse(QemuOpts *opts)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (sockets * cores * threads != max_cpus) {
|
||||
warn_report("Invalid CPU topology deprecated: "
|
||||
"sockets (%u) * cores (%u) * threads (%u) "
|
||||
"!= maxcpus (%u)",
|
||||
sockets, cores, threads, max_cpus);
|
||||
}
|
||||
|
||||
smp_cpus = cpus;
|
||||
smp_cores = cores;
|
||||
smp_threads = threads;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue