libxl: make set_memory_target work on domains with no videoram
PATCH 1/1 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 <[email protected]>
tools/libxl/libxl.c +4 -3
@@ -2292,9 +2292,10 @@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); +if (videoram_s) + videoram =atoi (videoram_s); +else + videoram =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 );
Quoted 5 lines · Jeremy Fitzhardinge
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<[email protected]>
Acked-by Vincent Hanquez <[email protected]>
Thanks Jeremy,
Signature · 1 line
Vincent