From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [PATCH 03/27] Guest setup: allow the amount of RAM to be a runvar Date: Wed, 10 Dec 2014 19:09:18 +0100 Message-ID: <20141210180918.26400.69599.stgit@Abyss.station> References: <20141210180651.26400.13356.stgit@Abyss.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141210180651.26400.13356.stgit@Abyss.station> 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 Cc: Ian Jackson , Wei Liu , Ian Campbell List-Id: xen-devel@lists.xenproject.org From: Dario Faggioli 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 Cc: Wei Liu Cc: Ian Campbell Cc: Ian Jackson --- Osstest/TestSupport.pm | 3 ++- ts-debian-fixup | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index a3b6936..cdff8d5 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -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= <{Ether}' ] # on_poweroff = 'destroy' diff --git a/ts-debian-fixup b/ts-debian-fixup index f001418..f85b06d 100755 --- a/ts-debian-fixup +++ b/ts-debian-fixup @@ -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 _pcipassthrough_=