The host can be looked up from $gho->{Host} and the toolstack can be
looked up from the host.

Signed-off-by: Ian Campbell <ian.campb...@citrix.com>
---
v3: This replaces "TestSupport: guest_create takes a $ho"
---
 Osstest/TestSupport.pm         | 12 +++++++-----
 ts-debian-hvm-install          |  9 +++------
 ts-guest-destroy               |  2 +-
 ts-guest-destroy-hard          |  2 +-
 ts-redhat-install              |  9 +++------
 ts-rumpuserxen-demo-xenstorels |  2 +-
 6 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 37df50e..6124d19 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1325,14 +1325,16 @@ sub guest_await_shutdown ($$$) {
     return guest_await_state($ho,$gho, "shutdown", "s", $timeout);
 }
 
-sub guest_destroy ($$) {
-    my ($ho,$gho) = @_;
+sub guest_destroy ($) {
+    my ($gho) = @_;
+    my $ho = $gho->{Host};
     target_cmd_root($ho, toolstack($ho)->{Command}." destroy $gho->{Name}", 
40);
 }
 
-sub guest_create ($$) {
-    my ($gho,$toolstack) = @_;
-    target_cmd_root($gho->{Host}, "$toolstack create $gho->{CfgPath}", 100);
+sub guest_create ($) {
+    my ($gho) = @_;
+    my $ho = $gho->{Host};
+    target_cmd_root($ho, toolstack($ho)->{Command}." create $gho->{CfgPath}", 
100);
 }
 
 
diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install
index 0148eef..449b96c 100755
--- a/ts-debian-hvm-install
+++ b/ts-debian-hvm-install
@@ -41,9 +41,6 @@ our $disk_mb= 10000;
 our $guesthost= "$gn.guest.osstest";
 our $gho;
 
-our $toolstack= toolstack($ho)->{Command};
-
-
 sub preseed () {
 
     my $preseed_file = preseed_base('wheezy','',());
@@ -183,16 +180,16 @@ logm("Host has $host_freemem_mb MB free memory, setting 
guest memory size to $ra
 
 if (!$stage) {
     prep();
-    guest_create($gho,$toolstack);
+    guest_create($gho);
 } else {
     $gho= selectguest($gn,$gho);
 }
 if ($stage<2) {
     guest_await_reboot($ho,$gho,2000);
-    guest_destroy($ho,$gho);
+    guest_destroy($gho);
 }
 
 guest_editconfig_nocd($gho,$emptyiso);
-guest_create($gho,$toolstack);
+guest_create($gho);
 guest_await_dhcp_tcp($gho,300);
 guest_check_up($gho);
diff --git a/ts-guest-destroy b/ts-guest-destroy
index 738650a..b4340f6 100755
--- a/ts-guest-destroy
+++ b/ts-guest-destroy
@@ -25,7 +25,7 @@ tsreadconfig();
 our ($ho,$gho) = ts_get_host_guest(@ARGV);
 
 sub destroy () {
-    guest_destroy($ho, $gho);
+    guest_destroy($gho);
     guest_checkrunning($ho, $gho) and die $gho->{Name};
 }
 
diff --git a/ts-guest-destroy-hard b/ts-guest-destroy-hard
index 457ac72..57d7100 100755
--- a/ts-guest-destroy-hard
+++ b/ts-guest-destroy-hard
@@ -24,4 +24,4 @@ tsreadconfig();
 
 our ($ho,$gho) = ts_get_host_guest(@ARGV);
 
-guest_destroy($ho, $gho);
+guest_destroy($gho);
diff --git a/ts-redhat-install b/ts-redhat-install
index a0b1fab..22c3061 100755
--- a/ts-redhat-install
+++ b/ts-redhat-install
@@ -37,9 +37,6 @@ our $disk_mb= 50000;
 our $guesthost= "$gn.guest.osstest";
 our $gho;
 
-our $xl= toolstack($ho)->{Command};
-
-
 sub kickstart () {
     my $cryptpw= 
'$6$anjRJmBbJcrNJGWN$rqvGUhu8ITjvErdIA5C//w2R6b/6wAjHbaF7XF8u3lZg1XI3StthPIE6UII08scOFwASMOepCGpgtsYeCpjqb.';
     my $authkeys= authorized_keys();
@@ -152,16 +149,16 @@ sub prep () {
 
 if (!$stage) {
     prep();
-    guest_create($gho,$xl);
+    guest_create($gho);
 } else {
     $gho= selectguest($gn,$gho);
 }
 if ($stage<2) {
     guest_await_reboot($ho,$gho,2000);
-    guest_destroy($ho,$gho);
+    guest_destroy($gho);
 }
 
 guest_editconfig_nocd($gho,$emptyiso);
-guest_create($gho,$xl);
+guest_create($gho);
 guest_await_dhcp_tcp($gho,300);
 guest_check_up($gho);
diff --git a/ts-rumpuserxen-demo-xenstorels b/ts-rumpuserxen-demo-xenstorels
index 6698848..ed46843 100755
--- a/ts-rumpuserxen-demo-xenstorels
+++ b/ts-rumpuserxen-demo-xenstorels
@@ -40,7 +40,7 @@ sub arrangepreserve () {
 }
 
 sub start () {
-    guest_create($gho,toolstack($ho));
+    guest_create($gho);
 
     $domid = guest_find_domid($ho, $gho);
 }
-- 
2.1.4


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

Reply via email to