From: Roger Pau Monne Date: Thu, 9 Apr 2015 15:11:13 +0000 (+0200) Subject: FreeBSD: Cleanups relating to guest images and ts-freebsd-install script X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Fflight-52769;p=osstest.git FreeBSD: Cleanups relating to guest images and ts-freebsd-install script 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é Acked-by: Ian Jackson --- diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index a674f35..3c2af90 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -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; diff --git a/ts-freebsd-install b/ts-freebsd-install index 0f982d1..6e8fada 100755 --- a/ts-freebsd-install +++ b/ts-freebsd-install @@ -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 _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} ||:");