[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 11 of 11] libxl: proper accounting for the videoram
Remove the videoram from the memory target of the domains consistently, leave the total amount of memory in maxmem. Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> diff -r d008be183166 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Wed Sep 01 12:42:37 2010 +0100 +++ b/tools/libxl/libxl.c Wed Sep 01 12:44:36 2010 +0100 @@ -2836,12 +2836,13 @@ retry_transaction: dompath), "%"PRIu32, target_memkb); } - rc = xc_domain_memory_set_pod_target(ctx->xch, domid, (target_memkb - - videoram) / 4, NULL, NULL, NULL); + target_memkb -= videoram; + rc = xc_domain_memory_set_pod_target(ctx->xch, domid, target_memkb / 4, + NULL, NULL, NULL); if (rc != 0) { XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xc_domain_memory_set_pod_target domid=%d, memkb=%d " - "failed rc=%d\n", domid, (target_memkb - videoram) / 4, + "failed rc=%d\n", domid, target_memkb / 4, rc); abort = 1; goto out; @@ -2963,12 +2964,13 @@ retry_transaction: memorykb); } + new_target_memkb -= videoram; rc = xc_domain_memory_set_pod_target(ctx->xch, domid, - (new_target_memkb - videoram) / 4, NULL, NULL, NULL); + new_target_memkb / 4, NULL, NULL, NULL); if (rc != 0) { XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xc_domain_memory_set_pod_target domid=%d, memkb=%d " - "failed rc=%d\n", domid, (new_target_memkb - videoram) / 4, + "failed rc=%d\n", domid, new_target_memkb / 4, rc); abort = 1; goto out; diff -r d008be183166 tools/libxl/libxl_dom.c --- a/tools/libxl/libxl_dom.c Wed Sep 01 12:42:37 2010 +0100 +++ b/tools/libxl/libxl_dom.c Wed Sep 01 12:44:36 2010 +0100 @@ -100,7 +100,7 @@ int build_post(libxl_ctx *ctx, uint32_t ents[0] = "memory/static-max"; ents[1] = libxl_sprintf(&gc, "%d", info->target_memkb); ents[2] = "memory/target"; - ents[3] = libxl_sprintf(&gc, "%d", info->target_memkb); + ents[3] = libxl_sprintf(&gc, "%d", info->target_memkb - info->video_memkb); ents[4] = "memory/videoram"; ents[5] = libxl_sprintf(&gc, "%d", info->video_memkb); ents[6] = "domid"; _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |