debuggers.hg

changeset 22251:e01600ac7295

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.

[fixed up for conflicts with libxl__ naming policy changes -iwj]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date Wed Sep 22 18:03:41 2010 +0100 (2010-09-22)
parents d4a30bee5701
children db340d6e9b06
files tools/libxl/libxl.c tools/libxl/libxl_dom.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Wed Sep 22 18:02:36 2010 +0100
     1.2 +++ b/tools/libxl/libxl.c	Wed Sep 22 18:03:41 2010 +0100
     1.3 @@ -2952,12 +2952,13 @@ retry_transaction:
     1.4          }
     1.5      }
     1.6  
     1.7 +    new_target_memkb -= videoram;
     1.8      rc = xc_domain_memory_set_pod_target(ctx->xch, domid,
     1.9 -            (new_target_memkb - videoram) / 4, NULL, NULL, NULL);
    1.10 +            new_target_memkb / 4, NULL, NULL, NULL);
    1.11      if (rc != 0) {
    1.12          LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
    1.13                  "xc_domain_memory_set_pod_target domid=%d, memkb=%d "
    1.14 -                "failed rc=%d\n", domid, (new_target_memkb - videoram) / 4,
    1.15 +                "failed rc=%d\n", domid, new_target_memkb / 4,
    1.16                  rc);
    1.17          abort = 1;
    1.18          goto out;
     2.1 --- a/tools/libxl/libxl_dom.c	Wed Sep 22 18:02:36 2010 +0100
     2.2 +++ b/tools/libxl/libxl_dom.c	Wed Sep 22 18:03:41 2010 +0100
     2.3 @@ -110,7 +110,7 @@ int libxl__build_post(libxl_ctx *ctx, ui
     2.4      ents[0] = "memory/static-max";
     2.5      ents[1] = libxl__sprintf(&gc, "%d", info->max_memkb);
     2.6      ents[2] = "memory/target";
     2.7 -    ents[3] = libxl__sprintf(&gc, "%d", info->target_memkb);
     2.8 +    ents[3] = libxl__sprintf(&gc, "%d", info->target_memkb - info->video_memkb);
     2.9      ents[4] = "memory/videoram";
    2.10      ents[5] = libxl__sprintf(&gc, "%d", info->video_memkb);
    2.11      ents[6] = "domid";