debuggers.hg

changeset 22246:49a3c1721734

libxl: introduce the concept of dom0 minimum memory

Introduce a minimum value for the memory assigned to dom0.

[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 17:40:44 2010 +0100 (2010-09-22)
parents 7659c107b2f3
children 4aac6084fdc5
files tools/libxl/libxl.c tools/libxl/libxl_internal.h
line diff
     1.1 --- a/tools/libxl/libxl.c	Wed Sep 22 17:39:32 2010 +0100
     1.2 +++ b/tools/libxl/libxl.c	Wed Sep 22 17:40:44 2010 +0100
     1.3 @@ -2916,6 +2916,12 @@ retry_transaction:
     1.4          abort = 1;
     1.5          goto out;
     1.6      }
     1.7 +    if (!domid && new_target_memkb < LIBXL_MIN_DOM0_MEM) {
     1.8 +        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
     1.9 +                "new target for dom0 is below the minimum threshold\n");
    1.10 +        abort = 1;
    1.11 +        goto out;
    1.12 +    }
    1.13  
    1.14      if (relative)
    1.15          new_target_memkb = current_target_memkb + target_memkb;
     2.1 --- a/tools/libxl/libxl_internal.h	Wed Sep 22 17:39:32 2010 +0100
     2.2 +++ b/tools/libxl/libxl_internal.h	Wed Sep 22 17:40:44 2010 +0100
     2.3 @@ -43,6 +43,7 @@
     2.4  #define LIBXL_MAXMEM_CONSTANT 1024
     2.5  #define LIBXL_PV_EXTRA_MEMORY 1024
     2.6  #define LIBXL_HVM_EXTRA_MEMORY 2048
     2.7 +#define LIBXL_MIN_DOM0_MEM (128*1024)
     2.8  #define QEMU_SIGNATURE "QemuDeviceModelRecord"
     2.9  
    2.10  #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))