mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
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:
1 parent
9b07822c1a
commit
15fb9e3a4e
1 file changed
+1
-3
+1
-3
@@ -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);
|
||||
|
||||