]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
Guest setup: allow the amount of RAM to be a runvar
authorDario Faggioli <raistlin@linux.it>
Tue, 4 Nov 2014 17:18:07 +0000 (18:18 +0100)
committerDario Faggioli <raistlin@linux.it>
Wed, 10 Dec 2014 14:44:42 +0000 (15:44 +0100)
the value of which can be retrieved via guest_var('memory');.

This works for both PV and HVM Debian guests.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Osstest/TestSupport.pm
ts-debian-fixup

index a3b69367d690305d649e5986eb46acbd2d2ce39f..cdff8d57a0c29938313179748ee67e215549ca04 100644 (file)
@@ -1460,11 +1460,12 @@ sub prepareguest_part_xencfg ($$$$$) {
     my ($ho, $gho, $ram_mb, $xopts, $cfgrest) = @_;
     my $onreboot= $xopts->{OnReboot} || 'restart';
     my $vcpus= guest_var($gho, 'vcpus', $xopts->{DefVcpus} || 2);
+    my $memory= guest_var($gho, 'memory', $xopts->{DefMem} || $ram_mb);
     my $xoptcfg= $xopts->{ExtraConfig};
     $xoptcfg='' unless defined $xoptcfg;
     my $xencfg= <<END;
 name        = '$gho->{Name}'
-memory = ${ram_mb}
+memory = ${memory}
 vif         = [ 'type=ioemu,mac=$gho->{Ether}' ]
 #
 on_poweroff = 'destroy'
index f00141858774a26aafa7d7053b8bb2a0b76ceae0..f85b06d1e1dcd0612531c2871b0d0c6fad0f7cc8 100755 (executable)
@@ -113,10 +113,13 @@ sub setcfg ($$) {
 
 sub otherfixupcfg () {
     my $vcpus= guest_var($gho,'vcpus',1);
+    my $ram_mb= guest_var($gho,'memory',512);
     $cfg =~ s/^dhcp/#$&/mg;
     $cfg =~ s/^on_crash.*/on_crash='preserve'/mg;
     $cfg =~ s/^vcpus.*//mg;
     $cfg .= "\nvcpus = $vcpus\n";
+    $cfg =~ s/^memory.*//mg;
+    $cfg .= "\nmemory = $ram_mb\n";
 
     # PCI passthrough
     # Look for runvars   <gn>_pcipassthrough_<devtype>=<hostident>