xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xl: Update memory info in xenstore when use 'xl mem-set'
@ 2010-05-07  9:39 Yu Zhiguo
  2010-05-07 17:42 ` Ian Jackson
  0 siblings, 1 reply; 10+ messages in thread
From: Yu Zhiguo @ 2010-05-07  9:39 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

'xl mem-set' should update memory info in xenstore's vm info.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>

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;

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-05-14  2:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07  9:39 [PATCH] xl: Update memory info in xenstore when use 'xl mem-set' Yu Zhiguo
2010-05-07 17:42 ` Ian Jackson
2010-05-09  8:45   ` Yu Zhiguo
2010-05-12  6:26     ` [PATCH 0/2] xl: Add subcommand mem-max and fix mem-set Yu Zhiguo
2010-05-12  6:41       ` Yu Zhiguo
2010-05-12 11:33         ` Stefano Stabellini
2010-05-12 11:39           ` Stefano Stabellini
2010-05-14  2:15         ` [PATCH] xl: Fix missing memory target in xenstore Yu Zhiguo
2010-05-12 15:33       ` [PATCH 0/2] xl: Add subcommand mem-max and fix mem-set Jonathan Knowles
2010-05-13 12:21         ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).