]> xenbits.xensource.com Git - osstest.git/commitdiff
Debian HVM guests: Honour guest disk and ram size runvars
authorRobert Ho <robert.hu@intel.com>
Mon, 17 Aug 2015 05:48:04 +0000 (13:48 +0800)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 25 Sep 2015 11:25:30 +0000 (12:25 +0100)
Allow runvars to specify guest disk and ram size, turning previous
values into defaults:

The default disk size for the guest is `10000M' which is not going to
be sufficient for nested HVM tests.  We are going to want to use a
larger disk size for the nested L1.  The appropriate disk_size will be
defined in make-flight, in forthcoming changes.

Also, also allow ram size to be defined by runvar.  The runvar takes
precedence over the default (which is calculated based on host RAM
etc.)

No functional change with current sets of runvars.

Signed-off-by: Robert Ho <robert.hu@intel.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm
ts-debian-hvm-install

index 7ba51ec3a6af8ae9d5c75e336e4d10873091ab9f..d966fe1c5d35d40ce075473f1ff98bae24e46c5e 100644 (file)
@@ -1745,7 +1745,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);
index 5fb6f4c554f10d30f3b01f51b2b2a8569c7aa2c6..f2fc31b5a38a69b8f818cce34cf63a350c815dab 100755 (executable)
@@ -220,13 +220,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},