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

Re: [Xen-devel] libxl: setmaxmem functionality?

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] libxl: setmaxmem functionality?
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 25 May 2011 13:12:15 +0100
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, Markus Groß <gross@xxxxxxxxxxxxx>, Stefano
Delivery-date: Wed, 25 May 2011 05:10:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1306312726.20576.211.camel@xxxxxxxxxxxxxxxxxxxxxx>
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: <201105251033.57042.gross@xxxxxxxxxxxxx> <1306312726.20576.211.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Wed, 25 May 2011, Ian Campbell wrote:
> On Wed, 2011-05-25 at 09:33 +0100, Markus Groß wrote:
> > 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.
 
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).

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

diff -r 37c77bacb52a tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon May 23 17:38:28 2011 +0100
+++ b/tools/libxl/libxl.c       Wed May 25 12:06:28 2011 +0000
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>