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 <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Wei Liu authored and Ian Campbell committed 2015-09-11 16:31:11 +01:00
1 parent fa6b5490be
commit ebe3fd9e73
1 file changed
+3
+3
View File
@@ -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));
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.