qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/core/machine-smp: Remove deprecated "parameter=0" SMP con


From: Prasad Pandit
Subject: Re: [PATCH] hw/core/machine-smp: Remove deprecated "parameter=0" SMP configurations
Date: Mon, 4 Mar 2024 11:23:58 +0530

On Mon, 4 Mar 2024 at 10:02, Zhao Liu <zhao1.liu@linux.intel.com> wrote:
> diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
> index 25019c91ee36..96533886b14e 100644
> --- a/hw/core/machine-smp.c
> +++ b/hw/core/machine-smp.c
> @@ -105,8 +105,9 @@ void machine_parse_smp_config(MachineState *ms,
>          (config->has_cores && config->cores == 0) ||
>          (config->has_threads && config->threads == 0) ||
>          (config->has_maxcpus && config->maxcpus == 0)) {
> -        warn_report("Deprecated CPU topology (considered invalid): "
> -                    "CPU topology parameters must be greater than zero");
> +        error_setg(errp, "Invalid CPU topology: "
> +                   "CPU topology parameters must be greater than zero");
> +        return;
>      }

unsigned maxcpus = config->has_maxcpus ? config->maxcpus : 0;
 ...
 if (config->has_maxcpus && config->maxcpus == 0)

* The check (has_maxcpus && maxcpus == 0) seems to be repeating above,
maybe we could check if (maxcpus == 0) error_setg(). And same for
other topology parameters?
* Also a check to ensure cpus <= maxcpus is required I think.

Thank you.
---
  - Prasad




reply via email to

[Prev in Thread] Current Thread [Next in Thread]