From: Yu Zhiguo <yuzg@cn.fujitsu.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] xl: Update memory info in xenstore when use 'xl mem-set'
Date: Fri, 07 May 2010 17:39:10 +0800 [thread overview]
Message-ID: <4BE3DFBE.2010901@cn.fujitsu.com> (raw)
'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;
next reply other threads:[~2010-05-07 9:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-07 9:39 Yu Zhiguo [this message]
2010-05-07 17:42 ` [PATCH] xl: Update memory info in xenstore when use 'xl mem-set' 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BE3DFBE.2010901@cn.fujitsu.com \
--to=yuzg@cn.fujitsu.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).