WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 4 of 9] libxl: introduce the concept of dom0 minimum

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4 of 9] libxl: introduce the concept of dom0 minimum memory
From: stefano.stabellini@xxxxxxxxxxxxx
Date: Fri, 27 Aug 2010 14:53:22 +0100
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 27 Aug 2010 06:57:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1008271440231.2545@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1008271440231.2545@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Introduce a minimum value for the memory assigned to dom0.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff -r 1276830b845f tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Thu Aug 26 18:55:46 2010 +0100
+++ b/tools/libxl/libxl.c       Thu Aug 26 18:56:16 2010 +0100
@@ -2841,6 +2841,12 @@ int libxl_set_memory_target(libxl_ctx *c
     char *uuid;
     xs_transaction_t t;
 
+    if (!domid && target_memkb < LIBXL_MIN_DOM0_MEM) {
+        XL_LOG(ctx, XL_LOG_ERROR,
+                "new target for dom0 is below the minimum threshold\n");
+        return ERROR_NOMEM;
+    }
+
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
 
@@ -2948,6 +2954,12 @@ retry_transaction:
         abort = 1;
         goto out;
     }
+    if (!domid && new_target_memkb < LIBXL_MIN_DOM0_MEM) {
+        XL_LOG(ctx, XL_LOG_ERROR,
+                "new target for dom0 is below the minimum threshold\n");
+        abort = 1;
+        goto out;
+    }
 
     videoram_s = libxl_xs_read(&gc, t, libxl_sprintf(&gc, 
"%s/memory/videoram", dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
diff -r 1276830b845f tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Thu Aug 26 18:55:46 2010 +0100
+++ b/tools/libxl/libxl_internal.h      Thu Aug 26 18:56:16 2010 +0100
@@ -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]))

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel