aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-09-22 17:40:44 +0100
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-09-22 17:40:44 +0100
commit98256664456f6d824fd0c3c8ed69eeca267e5ba8 (patch)
treeb4256ad1c0b7cfe3e298455441297a1172196e56 /tools
parent7010e9b7e4908ccf3c22f8f12722776b012d12e0 (diff)
downloadxen-98256664456f6d824fd0c3c8ed69eeca267e5ba8.tar.gz
xen-98256664456f6d824fd0c3c8ed69eeca267e5ba8.tar.bz2
xen-98256664456f6d824fd0c3c8ed69eeca267e5ba8.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/libxl/libxl.c6
-rw-r--r--tools/libxl/libxl_internal.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 8687441f1b..83830d1dbd 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2916,6 +2916,12 @@ retry_transaction:
abort = 1;
goto out;
}
+ if (!domid && new_target_memkb < LIBXL_MIN_DOM0_MEM) {
+ LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+ "new target for dom0 is below the minimum threshold\n");
+ abort = 1;
+ goto out;
+ }
if (relative)
new_target_memkb = current_target_memkb + target_memkb;
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 97e92965f6..180fdcd1ea 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -43,6 +43,7 @@
#define LIBXL_MAXMEM_CONSTANT 1024
#define LIBXL_PV_EXTRA_MEMORY 1024
#define LIBXL_HVM_EXTRA_MEMORY 2048
+#define LIBXL_MIN_DOM0_MEM (128*1024)
#define QEMU_SIGNATURE "QemuDeviceModelRecord"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))