@@ -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 () {
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@eu.citrix.com> --- Osstest/TestSupport.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)