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

[Xen-devel] [OSSTEST PATCH 04/16] Support guest-specific "toolstack" for guest creation



Some guests need creation in a special way.  For example, rump kernels
are ideally started with rumprun.  Honour a guest var which specifies
a toolstack name.

Osstest::TestSupport::toolstack now takes an optional $gho so it can
do this lookup when appropriate.

After creation the guest is necessarily managed with the toolstack for
the host, so we honour this (ie we pass the $gho) only for create.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index b18a19e..bc3ad13 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1583,7 +1583,7 @@ sub guest_create ($) {
     my ($gho) = @_;
     my $ho = $gho->{Host};
     guest_prepare_disk($gho);
-    toolstack($ho)->create($gho);
+    toolstack($ho,$gho)->create($gho);
 }
 
 sub guest_prepare_disk ($) {
@@ -2257,13 +2257,16 @@ sub guest_vncsnapshot_stash ($$$$) {
     target_getfile_root($ho,100, "$rfile", "$stash/$leaf");
 }
 
-sub toolstack ($) {
-    my ($ho) = @_;
-    return $ho->{_Toolstack} if $ho->{_Toolstack};
+sub toolstack ($;$) {
+    my ($ho,$gho) = @_;
+
+    my $cache = $gho || $ho;
+    return $cache->{_Toolstack} if $cache->{_Toolstack};
 
     my $tsname= $r{toolstack} || 'xend';
-    $ho->{_Toolstack}= get_host_method_object($ho, 'Toolstack', $tsname);
-    return $ho->{_Toolstack};
+    $tsname= guest_var($gho, 'toolstack', $tsname) if $gho;
+    $cache->{_Toolstack} = get_host_method_object($ho, 'Toolstack', $tsname);
+    return $cache->{_Toolstack};
 }
 
 sub authorized_keys () {
-- 
2.1.4


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

 


Rackspace

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