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

Re: [PATCH v2] tools/arm: Fix nr_spis handling v2



On Tue, Mar 25, 2025 at 12:00:29PM +0100, Michal Orzel wrote:
> diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
> index 2d895408cac3..0adcaa373b54 100644
> --- a/tools/libs/light/libxl_arm.c
> +++ b/tools/libs/light/libxl_arm.c
> @@ -181,13 +181,18 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
>  
>      LOG(DEBUG, "Configure the domain");
>  
> -    if (nr_spis > d_config->b_info.arch_arm.nr_spis) {
> -        LOG(ERROR, "Provided nr_spis value is too small (minimum required 
> %u)\n",
> -            nr_spis);
> -        return ERROR_FAIL;
> +    /* Check if a user provided a value or not */
> +    if (cfg_nr_spis != LIBXL_NR_SPIS_DEFAULT) {
> +        if (nr_spis > cfg_nr_spis) {
> +            LOG(ERROR, "Provided nr_spis value is too small (minimum 
> required %u)\n",
> +                nr_spis);
> +            return ERROR_FAIL;
> +        }
> +        config->arch.nr_spis = cfg_nr_spis;
>      }
> +    else
> +        config->arch.nr_spis = nr_spis;

Just one small coding style issue: to avoid confusion, whenever one side
a of an if..else is using a block, both side should use a block. But
that can be fixed on commit:
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.