From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Ho Subject: [OSSTest Nested v12 03/21] Allow runvars to specify guest disk and ram size (turning previous values into defaults) Date: Fri, 28 Aug 2015 23:07:52 +0800 Message-ID: <1440774490-16725-4-git-send-email-robert.hu@intel.com> References: <1440774490-16725-1-git-send-email-robert.hu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1440774490-16725-1-git-send-email-robert.hu@intel.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: xen-devel@lists.xen.org, robert.hu@intel.com Cc: wei.liu2@citrix.com, Ian.Jackson@eu.citrix.com, ian.campbell@citrix.com, di.zheng@intel.com, gordon.jin@intel.com List-Id: xen-devel@lists.xenproject.org 1. The default disk size for guest is '10000M' which is not sufficient for nested HVM guest, using larger disk size for nested guest to accommodate to nested test requirement, the specific disk_size is defined by make-flight. 2. Also, also allow ram size to be defined by runvar. It takes precedence over the calculation formula. 3. Add comment at the interface code. Signed-off-by: Robert Ho --- Osstest/TestSupport.pm | 3 ++- ts-debian-hvm-install | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 5bf0284..b7963af 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1726,7 +1726,8 @@ sub target_put_guest_image ($$;$) { sub more_prepareguest_hvm ($$$$;@) { my ($ho, $gho, $ram_mb, $disk_mb, %xopts) = @_; - + # $ram_mb and $disk_mb are defaults, used if runvars don't say + my $passwd= 'xenvnc'; prepareguest_part_lvmdisk($ho, $gho, $disk_mb); diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install index 864f038..f9bc5a5 100755 --- a/ts-debian-hvm-install +++ b/ts-debian-hvm-install @@ -200,13 +200,19 @@ sub prep () { my $host_freemem_mb = host_get_free_memory($ho); my $ram_minslop = 100; my $ram_lots = 5000; - if ($host_freemem_mb > $ram_lots * 2 + $ram_minslop) { - $ram_mb = $ram_lots; - } else { - $ram_mb = 768; + + $ram_mb = guest_var($gho,'memsize',undef); + if (!$ram_mb) { + if ($host_freemem_mb > $ram_lots * 2 + $ram_minslop) { + $ram_mb = $ram_lots; + } else { + $ram_mb = 768; + } } logm("Host has $host_freemem_mb MB free memory, setting guest memory size to $ram_mb MB"); + $disk_mb= guest_var($gho,'disksize',$disk_mb); + more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, OnReboot => 'preserve', Bios => $r{bios}, -- 1.8.3.1