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@citrix.com>
This commit is contained in:
Keir Fraser committed 2010-05-04 12:36:30 +01:00
1 parent 9b07822c1a
commit 15fb9e3a4e
1 file changed
+1 -3
+1 -3
View File
@@ -2292,9 +2292,7 @@ int libxl_set_memory_target(struct libxl_ctx *ctx, uint32_t domid, uint32_t targ
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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.