aboutsummaryrefslogtreecommitdiff
path: root/qemu-options.hx
diff options
context:
space:
mode:
authorYanan Wang <wangyanan55@huawei.com>2021-09-29 10:58:05 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-01 15:27:56 +0200
commit7d8c5a39628820f6927b8b70c8f54872f5d1a196 (patch)
tree0e2713d9bb3fc3c2e49f852c52c039aed0b7819c /qemu-options.hx
parent9a52b508061163df4dae05e708cd2a9cd790ad04 (diff)
machine: Set the value of cpus to match maxcpus if it's omitted
Currently we directly calculate the omitted cpus based on the given incomplete collection of parameters. This makes some cmdlines like: -smp maxcpus=16 -smp sockets=2,maxcpus=16 -smp sockets=2,dies=2,maxcpus=16 -smp sockets=2,cores=4,maxcpus=16 not work. We should probably set the value of cpus to match maxcpus if it's omitted, which will make above configs start to work. So the calculation logic of cpus/maxcpus after this patch will be: When both maxcpus and cpus are omitted, maxcpus will be calculated from the given parameters and cpus will be set equal to maxcpus. When only one of maxcpus and cpus is given then the omitted one will be set to its counterpart's value. Both maxcpus and cpus may be specified, but maxcpus must be equal to or greater than cpus. Note: change in this patch won't affect any existing working cmdlines but allows more incomplete configs to be valid. Signed-off-by: Yanan Wang <wangyanan55@huawei.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20210929025816.21076-6-wangyanan55@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-options.hx')
-rw-r--r--qemu-options.hx11
1 files changed, 8 insertions, 3 deletions
diff --git a/qemu-options.hx b/qemu-options.hx
index 4a092a092a..2eac830fdb 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -220,9 +220,14 @@ SRST
Simulate a SMP system with '\ ``n``\ ' CPUs initially present on
the machine type board. On boards supporting CPU hotplug, the optional
'\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be
- added at runtime. If omitted the maximum number of CPUs will be
- set to match the initial CPU count. Both parameters are subject to
- an upper limit that is determined by the specific machine type chosen.
+ added at runtime. When both parameters are omitted, the maximum number
+ of CPUs will be calculated from the provided topology members and the
+ initial CPU count will match the maximum number. When only one of them
+ is given then the omitted one will be set to its counterpart's value.
+ Both parameters may be specified, but the maximum number of CPUs must
+ be equal to or greater than the initial CPU count. Both parameters are
+ subject to an upper limit that is determined by the specific machine
+ type chosen.
To control reporting of CPU topology information, the number of sockets,
dies per socket, cores per die, and threads per core can be specified.