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 11] Remove "enforce" parameter to libxl memory t

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4 of 11] Remove "enforce" parameter to libxl memory target functions
From: stefano.stabellini@xxxxxxxxxxxxx
Date: Wed, 1 Sep 2010 14:41:03 +0100
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 01 Sep 2010 06:45:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1009011431340.2714@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.1009011431340.2714@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Always assume that the user wants to enforce the memory target for all
domains but dom0.

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

diff -r 1e423427f2aa tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Wed Sep 01 13:04:20 2010 +0100
+++ b/tools/libxl/libxl.c       Wed Sep 01 13:07:32 2010 +0100
@@ -2767,8 +2767,8 @@ out:
     return rc;
 }
 
-int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t
-        target_memkb, int enforce)
+int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid,
+        uint32_t target_memkb)
 {
     libxl_gc gc = LIBXL_INIT_GC(ctx);
     int rc = 1, abort = 0;
@@ -2787,7 +2787,7 @@ retry_transaction:
                 dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
 
-    if (enforce) {
+    if (domid) {
         rc = xc_domain_setmaxmem(ctx->xch, domid, target_memkb +
                 LIBXL_MAXMEM_CONSTANT);
         if (rc != 0) {
@@ -2834,7 +2834,7 @@ out:
 }
 
 int libxl_set_relative_memory_target(libxl_ctx *ctx, uint32_t domid,
-        int32_t relative_target_memkb, int enforce)
+        int32_t relative_target_memkb)
 {
     libxl_gc gc = LIBXL_INIT_GC(ctx);
     int rc = 1, abort = 0;
@@ -2906,7 +2906,7 @@ retry_transaction:
                 "%s/memory/videoram", dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
 
-    if (enforce) {
+    if (domid) {
         memorykb = new_target_memkb;
         rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb +
                 LIBXL_MAXMEM_CONSTANT);
diff -r 1e423427f2aa tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Wed Sep 01 13:04:20 2010 +0100
+++ b/tools/libxl/libxl.h       Wed Sep 01 13:07:32 2010 +0100
@@ -320,8 +320,8 @@ int libxl_domain_unpause(libxl_ctx *ctx,
 
 int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid, const char 
*filename);
 
-int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t 
target_memkb, int enforce);
-int libxl_set_relative_memory_target(libxl_ctx *ctx, uint32_t domid, int32_t 
relative_target_memkb, int enforce);
+int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t 
target_memkb);
+int libxl_set_relative_memory_target(libxl_ctx *ctx, uint32_t domid, int32_t 
relative_target_memkb);
 int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint32_t 
*out_target);
 
 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
diff -r 1e423427f2aa tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Sep 01 13:04:20 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Wed Sep 01 13:07:32 2010 +0100
@@ -1704,7 +1704,7 @@ static int set_memory_max(char *p, char 
         exit(3);
     }
 
-    rc = libxl_set_memory_target(&ctx, domid, memorykb, 1);
+    rc = libxl_set_memory_target(&ctx, domid, memorykb);
 
     return rc;
 }
@@ -1754,7 +1754,7 @@ static void set_memory_target(char *p, c
         exit(3);
     }
 
-    libxl_set_memory_target(&ctx, domid, memorykb, /* enforce */ 1);
+    libxl_set_memory_target(&ctx, domid, memorykb);
 }
 
 int main_memset(int argc, char **argv)

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