[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xl: Update memory info in xenstore when use 'xl mem-set'
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1273255050 -3600 # Node ID 0f6c6c0123dad011bf6b5b391fad75cc41e4ec46 # Parent caea94988515a3e0fdddbc51f380921687fcbb06 xl: Update memory info in xenstore when use 'xl mem-set' 'xl mem-set' should update memory info in xenstore's vm info. Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- tools/libxl/libxl.c | 11 +++++++++++ 1 files changed, 11 insertions(+) diff -r caea94988515 -r 0f6c6c0123da tools/libxl/libxl.c --- a/tools/libxl/libxl.c Fri May 07 11:45:18 2010 +0100 +++ b/tools/libxl/libxl.c Fri May 07 18:57:30 2010 +0100 @@ -2348,11 +2348,22 @@ int libxl_set_memory_target(struct libxl 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-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |