|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 4 of 5] libxl: log on failure in cpupool_info and libxl__domain_cpupool
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1340362601 -3600
# Node ID 2829b66dfe19afd4537ea4b2cfcef0cf28b49472
# Parent b63faf77bff33d7c9ebfe7260ecaffc26f3773a8
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@xxxxxxxxxx>
diff -r b63faf77bff3 -r 2829b66dfe19 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Fri Jun 22 11:55:29 2012 +0100
+++ b/tools/libxl/libxl.c Fri Jun 22 11:56:41 2012 +0100
@@ -562,16 +562,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))
+ rc = libxl_cpumap_alloc(CTX, &info->cpumap);
+ if (rc)
+ {
+ LOG(ERROR, "unable to allocate cpumap %d\n", rc);
goto out;
+ }
memcpy(info->cpumap.map, xcinfo->cpumap, info->cpumap.size);
rc = 0;
diff -r b63faf77bff3 -r 2829b66dfe19 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c Fri Jun 22 11:55:29 2012 +0100
+++ b/tools/libxl/libxl_dom.c Fri Jun 22 11:56:41 2012 +0100
@@ -67,10 +67,15 @@ int libxl__domain_cpupool(libxl__gc *gc,
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;
}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |