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

[Xen-devel] [OSSTEST PATCH 3/4] Runvar functions: Provide target_xenkernel_ver



This abstracts away a number of places that do
  guest_var($gho,'FOO',$r{xen_FOO})

We are going to change these runvar names.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm |    8 ++++++++
 ts-debian-install      |    6 +++---
 ts-logs-capture        |    2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 09694f4..a21d835 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -89,6 +89,7 @@ BEGIN {
 
                       target_ping_check_down target_ping_check_up
                       target_kernkind_check target_kernkind_console_inittab
+                      target_xenkernel_ver
                       target_var target_var_prefix
                       selectguest prepareguest more_prepareguest_hvm
                       guest_var guest_var_commalist guest_var_boolean
@@ -2018,6 +2019,13 @@ sub target_kernkind_check ($) {
     }
 }
 
+sub target_xenkernel_var ($$) {
+    my ($tho,$vn) = @_;
+    return
+       guest_var($gho,$vn,undef) //
+       $r{"xen_${vn}"};
+}
+
 sub target_kernkind_console_inittab ($$$) {
     my ($ho, $gho, $root) = @_;
 
diff --git a/ts-debian-install b/ts-debian-install
index 0dfe40c..510a766 100755
--- a/ts-debian-install
+++ b/ts-debian-install
@@ -49,10 +49,10 @@ sub ginstall () {
     my $archarg= defined($arch) ? "--arch $arch" : '';
     my $gsuite= guest_var($gho,'suite',$c{GuestDebianSuite});
 
-    my $kernpath = guest_var($gho,'kernel_path',$r{xen_kernel_path});
-    my $initrd = guest_var($gho,'initrd_path',$r{xen_initrd_path});
+    my $kernpath target_xenkernel_var($gho,'kernel_path');
+    my $initrd = target_xenkernel_ver($gho,'initrd_path');
     if (!$kernpath) {
-       my $kernver= guest_var($gho,'kernel_ver',$r{xen_kernel_ver});
+       my $kernver= target_xenkernel_ver($gho,'kernel_ver');
        $kernver ||= target_cmd_output($ho, 'uname -r');
        $kernpath = "/boot/vmlinuz-$kernver";
        $initrd ||= "/boot/initrd.img-$kernver";
diff --git a/ts-logs-capture b/ts-logs-capture
index b99b1db..ec66e11 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -210,7 +210,7 @@ sub fetch_xenctx_guest ($) {
 
     if (defined $gho->{Vcpus}) {
         foreach (my $vcpu=0; $vcpu < $gho->{Vcpus}; $vcpu++) {
-           my $kernpath = guest_var($gho,'kernel_path',$r{xen_kernel_path});
+           my $kernpath = target_xenkernel_var($gho,'kernel_path');
            my $sysmaparg = !defined $kernpath ? '' :
                $kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
                "-s $`/System.map-$'";
-- 
1.7.10.4


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