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

[Xen-devel] [PATCH 10/13] TestSupport: break out target_put_guest_image



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

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 0381fd8..314c727 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -54,6 +54,7 @@ BEGIN {
                       target_putfile target_putfile_root
                       target_putfilecontents_stash
                      target_putfilecontents_root_stash
+                      target_put_guest_image
                       target_editfile_root target_file_exists
                       target_install_packages target_install_packages_norec
                       target_extract_jobdistpath
@@ -1362,6 +1363,16 @@ END
     return $cfgpath;
 }
 
+sub target_put_guest_image ($$$) {
+    my ($ho, $gho, $default) = @_;
+    my $specimage = $r{"$gho->{Guest}_image"};
+    $specimage = $default if !defined $specimage;
+    die "$gho->{Guest} ?" unless $specimage;
+    my $limage= $specimage =~ m,^/, ? $specimage : "$c{Images}/$specimage";
+    $gho->{Rimage}= "/root/$flight.$job.".basename($specimage);
+    target_putfile_root($ho, 1000, $limage,$gho->{Rimage}, '-p');
+}
+
 sub more_prepareguest_hvm ($$$$;@) {
     my ($ho, $gho, $ram_mb, $disk_mb, %xopts) = @_;
     
@@ -1372,11 +1383,7 @@ sub more_prepareguest_hvm ($$$$;@) {
     my @disks = "phy:$gho->{Lvdev},hda,w";
 
     if (!$xopts{NoCdromImage}) {
-       my $specimage= $r{"$gho->{Guest}_image"};
-       die "$gho->{Guest} ?" unless $specimage;
-       my $limage= $specimage =~ m,^/, ? $specimage : "$c{Images}/$specimage";
-       $gho->{Rimage}= "/root/$flight.$job.".basename($specimage);
-       target_putfile_root($ho, 1000, $limage,$gho->{Rimage}, '-p');
+       target_transfer_guest_image($ho, $gho, undef);
 
        my $postimage_hook= $xopts{PostImageHook};
        $postimage_hook->() if $postimage_hook;
-- 
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®.