mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: call libxl_cpupoolinfo_{init, dispose} in numa_place_domain
Call libxl_cpupoolinfo_init at the beginning. Change two returns to goto out so that libxl_cpupoolinfo_dispose is called in failure path. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
cce28a5490
commit
deda96fb66
1 file changed
+3
-2
@@ -142,6 +142,7 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
|
||||
|
||||
libxl__numa_candidate_init(&candidate);
|
||||
libxl_bitmap_init(&cpupool_nodemap);
|
||||
libxl_cpupoolinfo_init(&cpupool_info);
|
||||
|
||||
/*
|
||||
* Extract the cpumap from the cpupool the domain belong to. In fact,
|
||||
@@ -150,10 +151,10 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
|
||||
*/
|
||||
rc = cpupool = libxl__domain_cpupool(gc, domid);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
goto out;
|
||||
rc = libxl_cpupool_info(CTX, &cpupool_info, cpupool);
|
||||
if (rc)
|
||||
return rc;
|
||||
goto out;
|
||||
|
||||
rc = libxl_domain_need_memory(CTX, info, &memkb);
|
||||
if (rc)
|
||||
|
||||