Skip to contentSkip to conversation

tools/xl: Call init function for libxl_bitmap

PATCH In review Uma Sharma 1 participant 1 message Oct 20, 2014

lore
Share & tools
lore

Uma Sharma

author
#0 lore raw

PATCH 3/4 tools/xl: Call init function for libxl_bitmap

This patch calls init function for libxl_bitmap in main_cpupoolnumasplit() and vcpuset() tools/libxl/xl_cmdimpl.c
IDL generated libxl types should be used only after calling the init function even if the variable is simply being passed by reference as an output parameter to a libxl function

--

tools/libxl/xl_cmdimpl.c +2 -0
index 38e53b0..2e923b4 100644
@@ -4844,6 +4844,7 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
     unsigned int max_vcpus, i;
     libxl_bitmap cpumap;
 
+    libxl_bitmap_init(&cpumap);
     max_vcpus = strtoul(nr_vcpus, &endptr, 10);
     if (nr_vcpus == endptr) {
         fprintf(stderr, "Error: Invalid argument.\n");
@@ -7261,6 +7262,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
 
     ret = 0;
 
+    libxl_bitmap_init(&cpumap);
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");