[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: make set_memory_target work on domains with no videoram



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1272972990 -3600
# Node ID 67303cccfb79206efd2975f9121807c95c05aa40
# Parent  df5fdbdfc4ce1adbc54776887a8fb4187ef58076
libxl: make set_memory_target work on domains with no videoram

If a domain has no videoram (say, dom0), then treat the size as 0 and
continue, rather than just failing.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 tools/libxl/libxl.c |    4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)

diff -r df5fdbdfc4ce -r 67303cccfb79 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue May 04 12:33:14 2010 +0100
+++ b/tools/libxl/libxl.c       Tue May 04 12:36:30 2010 +0100
@@ -2292,9 +2292,7 @@ int libxl_set_memory_target(struct libxl
     char *dompath = libxl_xs_get_dompath(ctx, domid);
 
     videoram_s = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, 
"%s/memory/videoram", dompath));
-    if (!videoram_s)
-        return -1;
-    videoram = atoi(videoram_s);
+    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_setmaxmem(ctx->xch, domid, target_memkb + 
LIBXL_MAXMEM_CONSTANT);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.