[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V2 2/2] ts-debian-hvm-install: fix guest memory size



If the host has more than 5G free memory, change guest memory size to 5G
to catch any error that triggers by crossing 4G boundary. Otherwise
guest memory size is set to 768 MB (taken from ts-redhat-install) which
should be a safe value to run this testcase on every host.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 ts-debian-hvm-install |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install
index 1b58108..8289ffb 100755
--- a/ts-debian-hvm-install
+++ b/ts-debian-hvm-install
@@ -32,7 +32,8 @@ $gn ||= 'ovmf';
 
 our $ho= selecthost($whhost);
 
-our $ram_mb=   6000;
+# guest memory size will be set based on host free memory, see below
+our $ram_mb=      0;
 our $disk_mb= 10000;
 
 our $guesthost= "$gn.guest.osstest";
@@ -166,6 +167,18 @@ sub prep () {
     });
 }
 
+# If host has >5G free memory, create a guest with 5G memory to catch any error
+# that triggers cross 4G boundary
+my $host_freemem_mb = host_get_free_memory($ho, $toolstack);
+my $ram_minslop = 100;
+my $ram_lots = 5000;
+if ($host_freemem_mb > $ram_lots + $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");
+
 if (!$stage) {
     prep();
     guest_create($gho,$toolstack);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.