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] xl: Update memory info in xenstore when use 'xl mem-

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xl: Update memory info in xenstore when use 'xl mem-set'
From: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
Date: Fri, 07 May 2010 17:39:10 +0800
Delivery-date: Fri, 07 May 2010 02:39:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 3.0a1 (Windows/2008050715)
'xl mem-set' should update memory info in xenstore's vm info.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>

diff -r ccae861f52f7 -r 5847ce53f5dc tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Thu May 06 11:59:55 2010 +0100
+++ b/tools/libxl/libxl.c       Sat May 08 01:38:51 2010 +0800
@@ -2290,11 +2290,22 @@
     uint32_t videoram;
     char *videoram_s = NULL;
     char *dompath = libxl_xs_get_dompath(ctx, domid);
+    xc_domaininfo_t info;
+    struct libxl_dominfo ptr;
+    char *uuid;
 
     videoram_s = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, 
"%s/memory/videoram", dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
 
     libxl_xs_write(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/memory/target", 
dompath), "%lu", target_memkb);
+
+    rc = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
+    if (rc != 1 || info.domain != domid)
+        return rc;
+    xcinfo2xlinfo(&info, &ptr);
+    uuid = libxl_uuid2string(ctx, ptr.uuid);
+    libxl_xs_write(ctx, XBT_NULL, libxl_sprintf(ctx, "/vm/%s/memory", uuid), 
"%lu", target_memkb / 1024);
+
     rc = xc_domain_setmaxmem(ctx->xch, domid, target_memkb + 
LIBXL_MAXMEM_CONSTANT);
     if (rc != 0)
         return rc;


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