From: Wei Liu Subject: Re: [PATCH 2/2] ts-debian-hvm-install: fix guest memory size Date: Mon, 14 Apr 2014 15:54:42 +0100 Message-ID: <20140414145442.GB3635@zion.uk.xensource.com> References: <1397474223-24387-1-git-send-email-wei.liu2@citrix.com> <1397474223-24387-3-git-send-email-wei.liu2@citrix.com> <21323.62612.597934.567330@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <21323.62612.597934.567330@mariner.uk.xensource.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: Ian Jackson Cc: Wei Liu , ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Apr 14, 2014 at 03:45:40PM +0100, Ian Jackson wrote: > Wei Liu writes ("[PATCH 2/2] ts-debian-hvm-install: fix guest memory size"): > > Change the default memory size to 768MB, which is taken from > > ts-redhat-install. It should be a safe size to make this test case run > > on every host. > ... > > -our $ram_mb= 6000; > > +our $ram_mb= 768; > > our $disk_mb= 10000; > > > > our $guesthost= "$gn.guest.osstest"; > > @@ -166,6 +166,14 @@ sub prep () { > > }); > > } > > > > +# If host has >5G free memory, create a guest with 5G memory to catch any error > > +# that triggers cross 4G boundary > > +our $host_freemem_mb = host_get_free_memory($ho, $toolstack); > > +if ($host_freemem_mb > 5000) { > > + $ram_mb = 5000; > > If the host has exactly 5000, this will result in failure. > That's because there's a "slack" required when building a domain. Hmm... I can check for 5010 then set guest memory to 5000. What do you think? > Also I don't like the separation of the two values for $ram_mb. The > manifest constant at the top of the script is misleading given that > the code might override it. I think you probably want to bury the > magic constant(s) in with the setting code. > Do you mean if ($host_freemem_mb > 5000){ $ram_mb = 5000; } else { $ram_mb = 768; } logm(...); Wei. > Thanks, > Ian.