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

[Xen-devel] [PATCH OSSTEST v2] Add $gho->{Suite} field to guest objects from {prepare, select}guest()



Currently those places which want this open code a lookup of the
{ident}_suite runvar with a fallback to the configuration file.

However selecthost was missing such a lookup in the case where it is
constructing a nested L1 host (which begins from the selectguest
template), which lead to ts-xen-install on Jessie missing the
installation of libnl-route-3-200.

Fix this by having prepareguest() store a {ident}_suite runvar (taking
care to handle the case where one is already set by e.g. make-flight)
and have selectguest() initialise $gho->Suite from it.

ts-debian-install, ts-debian-di-install and ts-debian-hvm-install now
simply use $gho->{Suite} instead of open coding the lookup.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
v2: Totally different approach, replacing "selecthost: Correctly set
    ->{Suite} for a nested host in selecthost()". Previous version
    had ts-debian-hvm-install using DebianGuestSuite and
    ts-xen-install using DebianSuite.
---
 Osstest/TestSupport.pm | 4 ++++
 ts-debian-di-install   | 2 +-
 ts-debian-hvm-install  | 2 +-
 ts-debian-install      | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index d1f7d36..51f9210 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1453,6 +1453,7 @@ sub selectguest ($$) {
         CfgPath => $r{"${gn}_cfgpath"},
         Tftp => $ho->{Tftp},
        Host => $ho,
+       Suite => $r{"${gn}_suite"},
     };
     foreach my $opt (guest_var_commalist($gho,'options')) {
         $gho->{Options}{$opt}++;
@@ -1695,6 +1696,9 @@ sub prepareguest ($$$$$$) {
     store_runvar("${gn}_tcpcheckport", $tcpcheckport);
     store_runvar("${gn}_boot_timeout", $boot_timeout);
 
+    store_runvar("${gn}_suite", $c{GuestDebianSuite})
+       unless $r{"${gn}_suite"};
+
     my $gho= selectguest($gn, $ho);
     store_runvar("${gn}_domname", $gho->{Name});
 
diff --git a/ts-debian-di-install b/ts-debian-di-install
index 64b5d44..d566a0d 100755
--- a/ts-debian-di-install
+++ b/ts-debian-di-install
@@ -190,7 +190,7 @@ END
 
     if ( $method eq "netboot" )
     {
-       my $suite= $r{"$gho->{Guest}_suite"};
+       my $suite= $gho->{Suite}};
        logm("$method $suite/$arch");
 
        $method_cfg = setup_netboot($tmpdir, $arch, $suite);
diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install
index 2c7580c..71cb23f 100755
--- a/ts-debian-hvm-install
+++ b/ts-debian-hvm-install
@@ -199,7 +199,7 @@ sub prep () {
                        $disk_mb + 1,
                        200);
 
-    $gsuite = guest_var($gho,'suite',$c{GuestDebianSuite});
+    $gsuite = $gho->{Suite};
     $kernel = iso_path('kernel', 'vmlinuz');
     $ramdisk = iso_path('ramdisk', 'initrd.gz');
 
diff --git a/ts-debian-install b/ts-debian-install
index 0dfe40c..4db9a3b 100755
--- a/ts-debian-install
+++ b/ts-debian-install
@@ -47,7 +47,7 @@ sub prep () {
 sub ginstall () {
     my $arch= $r{"$gho->{Guest}_arch"};
     my $archarg= defined($arch) ? "--arch $arch" : '';
-    my $gsuite= guest_var($gho,'suite',$c{GuestDebianSuite});
+    my $gsuite= $gho->{Suite};
 
     my $kernpath = guest_var($gho,'kernel_path',$r{xen_kernel_path});
     my $initrd = guest_var($gho,'initrd_path',$r{xen_initrd_path});
-- 
2.6.1


_______________________________________________
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®.