[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 3 of 4 V2] libxl: log on failure in cpupool_info and libxl__domain_cpupool
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1340956699 -3600 # Node ID 426b2f7429a792b9e54cbb8439d357c8edbd350a # Parent 763756d2590c84816782e2ffc2102c774366ed50 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 763756d2590c -r 426b2f7429a7 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Fri Jun 29 08:57:11 2012 +0100 +++ b/tools/libxl/libxl.c Fri Jun 29 08:58:19 2012 +0100 @@ -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; diff -r 763756d2590c -r 426b2f7429a7 tools/libxl/libxl_dom.c --- a/tools/libxl/libxl_dom.c Fri Jun 29 08:57:11 2012 +0100 +++ b/tools/libxl/libxl_dom.c Fri Jun 29 08:58:19 2012 +0100 @@ -64,10 +64,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 |