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

Re: [Xen-devel] [PATCH for 4.6 v3 3/3] xl: handle empty vnuma configuration



On Thu, 2015-09-10 at 15:50 +0100, Wei Liu wrote:
> When user specifies vnuma = [], we need to skip the whole parser
> function, otherwise the parser sets b_info->max_memkb to garbage value.

Arguably the bug here is in the code which does so without reference to
num_vnuma (the majority of this function does the right thing if num_vnuma
== 0).

However we may as well short circuit the whole thing regardless of this bug
so:

> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  tools/libxl/xl_cmdimpl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index ebbb9a5..7dbf37f 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -1093,6 +1093,9 @@ static void parse_vnuma_config(const XLU_Config
> *config,
>      if (xlu_cfg_get_list(config, "vnuma", &vnuma, &num_vnuma, 1))
>          return;
>  
> +    if (!num_vnuma)
> +        return;
> +
>      b_info->num_vnuma_nodes = num_vnuma;
>      b_info->vnuma_nodes = xcalloc(num_vnuma, sizeof(libxl_vnode_info));
>      vcpu_parsed = xcalloc(num_vnuma, sizeof(libxl_bitmap));

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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