mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: log on failure in cpupool_info and libxl__domain_cpupool
Also in cpupool_info propagate the failure value from libxl_cpumap_alloc. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
This commit is contained in:
1 parent
904efa0b84
commit
dfa73b4a9b
2 files changed
+18
-2
No files matched your search
+12
-1
@@ -571,16 +571,27 @@ static int cpupool_info(libxl__gc *gc,
|
||||
|
||||
xcinfo = xc_cpupool_getinfo(CTX->xch, poolid);
|
||||
if (xcinfo == NULL)
|
||||
{
|
||||
LOGE(ERROR, "failed to get info for cpupool%d\n", poolid);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
if (exact && xcinfo->cpupool_id != poolid)
|
||||
{
|
||||
LOG(ERROR, "got info for cpupool%d, wanted cpupool%d\n",
|
||||
xcinfo->cpupool_id, poolid);
|
||||
goto out;
|
||||
}
|
||||
|
||||
info->poolid = xcinfo->cpupool_id;
|
||||
info->sched = xcinfo->sched_id;
|
||||
info->n_dom = xcinfo->n_dom;
|
||||
if (libxl_cpumap_alloc(CTX, &info->cpumap, 0))
|
||||
rc = libxl_cpumap_alloc(CTX, &info->cpumap, 0);
|
||||
if (rc)
|
||||
{
|
||||
LOG(ERROR, "unable to allocate cpumap %d\n", rc);
|
||||
goto out;
|
||||
}
|
||||
memcpy(info->cpumap.map, xcinfo->cpumap, info->cpumap.size);
|
||||
|
||||
rc = 0;
|
||||
|
||||
@@ -64,10 +64,15 @@ int libxl__domain_cpupool(libxl__gc *gc, uint32_t domid)
|
||||
|
||||
ret = xc_domain_getinfolist(CTX->xch, domid, 1, &info);
|
||||
if (ret != 1)
|
||||
{
|
||||
LOGE(ERROR, "getinfolist failed %d\n", ret);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
if (info.domain != domid)
|
||||
{
|
||||
LOGE(ERROR, "got info for dom%d, wanted dom%d\n", info.domain, domid);
|
||||
return ERROR_FAIL;
|
||||
|
||||
}
|
||||
return info.cpupool;
|
||||
}
|
||||
|
||||
|
||||