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

[Xen-devel] [PATCH OSSTEST v2 07/12] ts-debian-di-install: Allow Di Version to come from runvars



and following the lead of the suite arrange for a version selected
from the defaults to be written back to the runvars.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
v2: s/diversion/di_version/
---
 Osstest/Debian.pm    | 15 ++++++++++++++-
 ts-debian-di-install |  3 ++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 93b0ad4..daca0b7 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -35,7 +35,7 @@ BEGIN {
     @ISA         = qw(Exporter);
     @EXPORT      = qw(debian_boot_setup
                       debian_overlays
-                      debian_guest_suite
+                      debian_guest_suite debian_guest_di_version
                       %preseed_cmds
                       preseed_base
                       preseed_create
@@ -1352,4 +1352,17 @@ sub debian_guest_suite ($) {
     return $gho->{Suite};
 }
 
+sub debian_guest_di_version ($) {
+    my ($gho) = @_;
+
+    $gho->{DiVersion} //= guest_var($gho,'di_version',undef);
+
+    if (!$gho->{DiVersion}) {
+       $gho->{DiVersion} = $c{TftpDiVersion};
+       store_runvar("$gho->{Guest}_di_version", $gho->{DiVersion});
+    }
+
+    return $gho->{DiVersion};
+}
+
 1;
diff --git a/ts-debian-di-install b/ts-debian-di-install
index 9a513d3..9875bef 100755
--- a/ts-debian-di-install
+++ b/ts-debian-di-install
@@ -151,7 +151,8 @@ sub setup_netboot($$$)
        die if $r{ "$gho->{Guest}_netboot_kernel" }
        ||     $r{ "$gho->{Guest}_netboot_ramdisk" };
 
-       my $di_path = 
$c{TftpPath}.'/'.$ho->{Tftp}{DiBase}.'/'.${arch}.'/'.$c{TftpDiVersion}.'-'.$ho->{Suite};
+       my $di_path = $c{TftpPath}.'/'.$ho->{Tftp}{DiBase}.'/'.${arch}.'/'.\
+           debian_guest_diversion($ho).'-'.$ho->{Suite};
 
         if (${arch} =~ m/amd64|i386/) {
            $kernel = "$di_path/vmlinuz-xen";
-- 
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®.