|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v3] Set {ident}_suite runvar when install a Debian 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 providing debian_guest_suite($gho) which as well as
initialising $gho->{Suite} stores an {ident}_suite runvar (taking care
to handle the case where one is already set by e.g. make-flight). For
convenience debian_guest_suite() also returns the suite name.
ts-debian-install, ts-debian-di-install and ts-debian-hvm-install now
use debian_guest_suite instead of open coding the lookup.
The final piece of the puzzle is to have selectguest() pickup the
{ident}_suite runvar (if it is set) and initialise $gho->{Suite} from
it.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
I've kicked off an adhoc run testing:
+ test-amd64-amd64-qemuu-nested);; # nested
+ test-amd64-amd64-xl-qemuu-debianhvm-amd64);; # regular HVM
+ test-amd64-amd64-xl-qcow2);; # DI install
+ test-amd64-amd64-xl);; # Normal PV
with this change.
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.
v3: Another different approach, replacing "Add $gho->{Suite} field to
guest objects from {prepare,select}guest()".
---
Osstest/Debian.pm | 15 +++++++++++++++
Osstest/TestSupport.pm | 1 +
ts-debian-di-install | 2 +-
ts-debian-hvm-install | 2 +-
ts-debian-install | 2 +-
5 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 317f663..c9b8e17 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -35,6 +35,7 @@ BEGIN {
@ISA = qw(Exporter);
@EXPORT = qw(debian_boot_setup
debian_overlays
+ debian_guest_suite
%preseed_cmds
preseed_base
preseed_create
@@ -1335,4 +1336,18 @@ sub preseed_hook_cmds () {
return $preseed;
}
+sub debian_guest_suite ($) {
+ my ($gho) = @_;
+
+ return $gho->{Suite} if $gho->{Suite};
+
+ $gho->{Suite} = guest_var($gho,'suite',undef);
+
+ if ( ! $gho->{Suite} ) {
+ $gho->{Suite} = $c{GuestDebianSuite};
+ store_runvar("$gho->{Guest}_suite", $gho->{Suite});
+ }
+ return $gho->{Suite};
+}
+
1;
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index d1f7d36..61e885a 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}++;
diff --git a/ts-debian-di-install b/ts-debian-di-install
index 64b5d44..a9b3b20 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= debian_guest_suite($gho);
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..96190a1 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 = debian_guest_suite($gho);
$kernel = iso_path('kernel', 'vmlinuz');
$ramdisk = iso_path('ramdisk', 'initrd.gz');
diff --git a/ts-debian-install b/ts-debian-install
index 0dfe40c..c8002d9 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= debian_guest_suite($gho);
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |