libxl: libxl_domain_setmaxmem: actually call xc_domain_setmaxmem
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 26 May 2011 14:05:47 +0000 (15:05 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 26 May 2011 14:05:47 +0000 (15:05 +0100)
Currently libxl_domain_setmaxmem doesn't do anything, but it should call
xc_domain_setmaxmem to enforce the new "xen maximum" target for the
domain (see tools/libxl/libxl_memory.txt).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c

index a096d60f3d72bc29ef6c638878e9f93fb6d90f06..83c566f438bd76ede7c1f42ef65a6aec5e0e94f4 100644 (file)
@@ -1795,6 +1795,13 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t max_memkb)
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "memory_static_max must be greater than or or equal to memory_dynamic_max\n");
         goto out;
     }
+    rc = xc_domain_setmaxmem(ctx->xch, domid, max_memkb + LIBXL_MAXMEM_CONSTANT);
+    if (rc != 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                "xc_domain_setmaxmem domid=%d memkb=%d failed "
+                "rc=%d\n", domid, max_memkb + LIBXL_MAXMEM_CONSTANT, rc);
+        goto out;
+    }
 
     rc = 0;
 out: