]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
FreeBSD: Cleanups relating to guest images and ts-freebsd-install script
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 9 Apr 2015 15:11:13 +0000 (17:11 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 14 Apr 2015 15:48:57 +0000 (16:48 +0100)
Remove some unused variables from ts-freebsd-install script. Also make the
third parameter of target_put_guest_image optional and fix both callers of
this function.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Osstest/TestSupport.pm
ts-freebsd-install

index a674f35a8a035828e787392835ee21d18ec3f3ec..3c2af90abd636fd4a9b8fe35859e8c28434d799f 100644 (file)
@@ -1560,7 +1560,7 @@ END
     return $cfgpath;
 }
 
-sub target_put_guest_image ($$$) {
+sub target_put_guest_image ($$;$) {
     my ($ho, $gho, $default) = @_;
     my $specimage = $r{"$gho->{Guest}_image"};
     $specimage = $default if !defined $specimage;
@@ -1580,7 +1580,7 @@ sub more_prepareguest_hvm ($$$$;@) {
     my @disks = "phy:$gho->{Lvdev},hda,w";
 
     if (!$xopts{NoCdromImage}) {
-       target_put_guest_image($ho, $gho, undef);
+       target_put_guest_image($ho, $gho);
 
        my $postimage_hook= $xopts{PostImageHook};
        $postimage_hook->() if $postimage_hook;
index 0f982d12b4a09b921140f29e7ce95a254904436e..6e8fada0908d426f52d2b393cf6ab3a8f490786f 100755 (executable)
@@ -36,18 +36,6 @@ our $gho;
 
 our $mnt= '/root/freebsd_root';
 
-our $freebsd_version= "10.0-BETA3";
-
-# Folder where the FreeBSD VM images are stored inside of the host
-#
-# The naming convention of the stored images is:
-# FreeBSD-$freebsd_version-$arch.qcow2.xz
-# ie: FreeBSD-10.0-BETA3-amd64.qcow2.xz
-#
-# Used only if the runvar <guest>_image is not set.
-#
-our $freebsd_vm_repo= '/var/images';
-
 sub prep () {
     my $authkeys= authorized_keys();
 
@@ -59,13 +47,8 @@ sub prep () {
 
     more_prepareguest_hvm($ho, $gho, $ram_mb, $disk_mb, NoCdromImage => 1);
 
-    target_put_guest_image($ho, $gho,
-                          "$freebsd_vm_repo/FreeBSD-$freebsd_version-".
-                          (defined($r{"$gho->{Guest}_arch"})
-                           # Use amd64 as default arch
-                           ? $r{"$gho->{Guest}_arch"} : 'amd64').
-                          ".qcow2.xz");
-                               
+    target_put_guest_image($ho, $gho);
+
     my $rootpartition_dev = target_guest_lv_name($ho, $gho->{Name}) . "--disk3";
 
     target_cmd_root($ho, "umount $gho->{Lvdev} ||:");