From ebe3fd9e736dda6cb141abe1241f0c8491125ebc Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 11 Sep 2015 14:50:09 +0100 Subject: [PATCH] xl: handle empty vnuma configuration When user specifies vnuma = [], we need to skip the whole parser function, otherwise the parser sets b_info->max_memkb to garbage value. Signed-off-by: Wei Liu Acked-by: Ian Campbell --- 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 c9bd8397d0..bfbd42128d 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)); -- 2.39.5