From: Ian Jackson Subject: Re: [PATCH 1/1] libxl: set stub domain size based on VRAM size Date: Fri, 10 Jul 2015 16:48:54 +0100 Message-ID: <21919.59750.996499.407969@mariner.uk.xensource.com> References: <1436542562-1118-1-git-send-email-eshelton@pobox.com> <1436542562-1118-2-git-send-email-eshelton@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZDaXu-0005Rl-2J for xen-devel@lists.xenproject.org; Fri, 10 Jul 2015 15:49:04 +0000 In-Reply-To: <1436542562-1118-2-git-send-email-eshelton@pobox.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Eric Shelton Cc: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, wei.liu2@citrix.com, samuel.thibault@ens-lyon.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Eric Shelton writes ("[PATCH 1/1] 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. > dm_config->b_info.max_vcpus = 1; > dm_config->b_info.max_memkb = 32 * 1024; > + if (guest_config->b_info.video_memkb > 4096) > + dm_config->b_info.max_memkb += guest_config->b_info.video_memkb - 4096; Thanks for diagnosing this. This seems a reasonable approach to me. I have only one small stylistic comment: please use max() as found in libxl_internal.h. Eg, dm_config->b_info.max_memkb = 28 * 1024 + max(guest_config->b_info.video_memkb, 4096); Ian.