libxenlight: fix two memory related issues
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 11 Dec 2009 08:45:26 +0000 (08:45 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 11 Dec 2009 08:45:26 +0000 (08:45 +0000)
- 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>
tools/libxl/libxl_dom.c
tools/libxl/libxl_internal.h

index 60affe9207ffdb7abc96be5dac739062ad780bbc..b96e5e6258c96eb4819324aab3cade5ec5a353e3 100644 (file)
@@ -130,7 +130,7 @@ int build_pv(struct libxl_ctx *ctx, uint32_t domid,
         XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "xc_dom_allocate failed");
         return -1;
     }
-    if ((ret = xc_dom_linux_build(ctx->xch, dom, domid, info->max_memkb / 1024,
+    if ((ret = xc_dom_linux_build(ctx->xch, dom, domid, info->target_memkb / 1024,
                                   info->kernel, info->u.pv.ramdisk, flags,
                                   state->store_port, &state->store_mfn,
                                   state->console_port, &state->console_mfn)) != 0) {
index b793430ef9df655973c0a0fa40d1d7d1e8b3cf63..fd7838858ced75295204207195264b0a8383a9ea 100644 (file)
@@ -31,7 +31,7 @@
 #define LIBXL_DEVICE_MODEL_START_TIMEOUT 10
 #define LIBXL_XENCONSOLE_LIMIT 1048576
 #define LIBXL_XENCONSOLE_PROTOCOL "vt100"
-#define LIBXL_MAXMEM_CONSTANT (1 * 1024 * 1024)
+#define LIBXL_MAXMEM_CONSTANT 1024
 #define QEMU_SIGNATURE "QemuDeviceModelRecord"
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))