debuggers.hg

changeset 20654:9575425fdebd

libxenlight: fix two memory related issues

- LIBXL_MAXMEM_CONSTANT is 1MB but must be expressed in KB;

- xc_dom_linux_build should take target_memkb instead of max_memkb as
an argument.

Thanks to Andres for spotting the latter.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Dec 11 08:45:26 2009 +0000 (2009-12-11)
parents 5f076dbdab6c
children 8fbc74d40739
files tools/libxl/libxl_dom.c tools/libxl/libxl_internal.h
line diff
     1.1 --- a/tools/libxl/libxl_dom.c	Fri Dec 11 08:44:33 2009 +0000
     1.2 +++ b/tools/libxl/libxl_dom.c	Fri Dec 11 08:45:26 2009 +0000
     1.3 @@ -130,7 +130,7 @@ int build_pv(struct libxl_ctx *ctx, uint
     1.4          XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xc_dom_allocate failed");
     1.5          return -1;
     1.6      }
     1.7 -    if ((ret = xc_dom_linux_build(ctx->xch, dom, domid, info->max_memkb / 1024,
     1.8 +    if ((ret = xc_dom_linux_build(ctx->xch, dom, domid, info->target_memkb / 1024,
     1.9                                    info->kernel, info->u.pv.ramdisk, flags,
    1.10                                    state->store_port, &state->store_mfn,
    1.11                                    state->console_port, &state->console_mfn)) != 0) {
     2.1 --- a/tools/libxl/libxl_internal.h	Fri Dec 11 08:44:33 2009 +0000
     2.2 +++ b/tools/libxl/libxl_internal.h	Fri Dec 11 08:45:26 2009 +0000
     2.3 @@ -31,7 +31,7 @@
     2.4  #define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
     2.5  #define LIBXL_XENCONSOLE_LIMIT 1048576
     2.6  #define LIBXL_XENCONSOLE_PROTOCOL "vt100"
     2.7 -#define LIBXL_MAXMEM_CONSTANT (1 * 1024 * 1024)
     2.8 +#define LIBXL_MAXMEM_CONSTANT 1024
     2.9  #define QEMU_SIGNATURE "QemuDeviceModelRecord"
    2.10  
    2.11  #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))