On Tue, Sep 28, 2021 at 11:57:45AM +0800, Yanan Wang wrote: > 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 <wangyana...@huawei.com> > Reviewed-by: Andrew Jones <drjo...@redhat.com> > --- > hw/core/machine.c | 29 ++++++++++++++++------------- > hw/i386/pc.c | 29 ++++++++++++++++------------- > qemu-options.hx | 11 ++++++++--- > 3 files changed, 40 insertions(+), 29 deletions(-)
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|