Hi,
On Tue, 5 Mar 2024 at 12:59, Zhao Liu <zhao1.liu(a)linux.intel.com> wrote:
After simple test, if user sets maxcpus as 0, the has_maxcpus will
be
true as well...I think it's related with QAPI code generation logic.
* Right.
[Maybe we digressed a bit in the discussion, so I snipped much of the
details here. Sorry about that.]
* "if user sets maxcpus as 0, the has_maxcpus will be true as well",
ie if 'has_*' fields are always set
unsigned maxcpus = config->has_maxcpus ? config->maxcpus : 0;
then checking 'config->has_maxcpus ?' above is probably not required I
think. It could just be
maxcpus = config->maxcpus
If a user does not specify config->maxcpus with -smp option, then it
could default to zero(0) in 'config' parameter? (same for other config
fields)
* If such change requires API changes (I'm not sure how), then
probably it is outside the scope of this patch.
...wdyt?
Thank you.
---
- Prasad