Skip to contentSkip to conversation

libxl: setmaxmem functionality?

DISCUSSION Markus Groß 4 participants 4 messages May 25, 2011 – May 26, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

the function libxl_domain_setmaxmem in libxl.c doesn't seem to do anything besides argument checking, or am I overlooking something?

Cheers,
Markus

#1 lore raw
Quoted 5 lines · Markus Groß

Hi,

the function libxl_domain_setmaxmem in libxl.c doesn't seem to do anything besides argument checking, or am I overlooking something?

Um, no, you appear to be quite correct. How strange!

It seems like the actual meat of the function was removed in 22196:4f90c1fde133. The changelog message mentions massaging the patch due to some unrelated code motion -- perhaps something went wrong there? IanJ and Stefano CCd.

Ian.

#2 lore raw
Quoted 7 lines · Ian Campbell
Quoted 5 lines · Markus Groß

Hi,

the function libxl_domain_setmaxmem in libxl.c doesn't seem to do anything besides argument checking, or am I overlooking something?

Quoted 6 lines

Um, no, you appear to be quite correct. How strange!

It seems like the actual meat of the function was removed in 22196:4f90c1fde133. The changelog message mentions massaging the patch due to some unrelated code motion -- perhaps something went wrong there? IanJ and Stefano CCd.

22196 is correct: static-max shouldn't be changed there. The problem is that libxl_domain_setmaxmem doesn't call xc_domain_setmaxmem.

---

libxl_domain_setmaxmem: actually call xc_domain_setmaxmem

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).

tools/libxl/libxl.c +7 -0
diff -r 37c77bacb52a tools/libxl/libxl.c
@@ -1794,6 +1794,13 @@ int libxl_domain_setmaxmem(libxl_ctx *ct
         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:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Acked-by
#3 lore raw

Stefano Stabellini writes ("Re: [Xen-devel] libxl: setmaxmem functionality?"):

Quoted 7 lines

libxl_domain_setmaxmem: actually call xc_domain_setmaxmem

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).