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
|