From: Eric Shelton Date: Sat, 11 Jul 2015 21:30:42 +0000 (-0400) Subject: libxl: set stub domain size based on VRAM size X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2767 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d727bfcd0b6150825112def7eb50dfbb72f188f4;p=xen.git libxl: set stub domain size based on VRAM size Allocate additional memory to the stub domain for qemu-traditional if more than 4 MB is assigned to the video adapter to avoid out of memory condition for QEMU. For LIBXL_VGA_INTERFACE_TYPE_STD + CIRRUS video_memkb is always at least 4MB. However if LIBXL_VGA_INTERFACE_TYPE_STD is selected the video_memkb defaults to 0, resulting in a stubdom which is 4MB smaller than before. It seems unlikely that VGA disable would require more memory then the other options, so this should be ok. Signed-off-by: Eric Shelton Acked-by: Ian Campbell [ ijc -- added second paragraph of commit message ] --- diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index f9911ac3a8..19fb2e408d 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1096,7 +1096,8 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss) libxl_domain_build_info_init_type(&dm_config->b_info, LIBXL_DOMAIN_TYPE_PV); dm_config->b_info.max_vcpus = 1; - dm_config->b_info.max_memkb = 32 * 1024; + dm_config->b_info.max_memkb = 28 * 1024 + + guest_config->b_info.video_memkb; dm_config->b_info.target_memkb = dm_config->b_info.max_memkb; dm_config->b_info.u.pv.features = "";