]> xenbits.xensource.com Git - xen.git/commit
libxl: properly clean up array in libxl_list_cpupool failure path
authorWei Liu <wei.liu2@citrix.com>
Mon, 27 Jul 2015 17:45:02 +0000 (18:45 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 28 Jul 2015 10:53:11 +0000 (11:53 +0100)
commitc15bcbbcea383d1a1ac3c16cdea5ada4f26c5611
tree1a994a3f38ad6be6f392a490b39a8c3bb1483157
parent6094fe493701095414108ead0f100b18af1ccd04
libxl: properly clean up array in libxl_list_cpupool failure path

Document how cpupool_info works.  Distinguish success (ERROR_FAIL +
ENOENT) vs failure in libxl_list_cpupool and properly clean up the array
in failure path.

Also switch to libxl__realloc and call libxl_cpupool_{init,dispose}
where appropriate.

There is change of behaviour. Previously if memory allocation fails the
said function returns NULL. Now memory allocation failure is fatal. This
is in line with how we deal with memory allocation failure in other
places in libxl though.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c