]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
target_var: Support fallback to all_(guest|host)_$vn
authorIan Campbell <ian.campbell@citrix.com>
Mon, 18 Jan 2016 14:28:47 +0000 (14:28 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 17 Feb 2016 11:16:23 +0000 (11:16 +0000)
Having to set {ident}_foo for all idents used in a job (e.g host vs
src_host+dst_host) in make-flight would be a little fiddly.

Instead follow the lead of all_hostflags and consult all_host_$vn.

I have no immediate use for all_guest_$vn, but support it for
consistency.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm

index 2141905d5a1dae5aaeb7f395e096472a04be45b1..742b2e326743498ae34ca6b89cccb3bdd9833b9a 100644 (file)
@@ -2094,7 +2094,10 @@ sub target_var_prefix ($) {
 
 sub target_var ($$) {
     my ($ho,$vn) = @_;
-    return $r{ target_var_prefix($ho). $vn };
+    my $pfx = target_var_prefix($ho);
+    my $allthing = exists $ho->{Guest} ? "guest" : "host";
+    return $r{ $pfx. $vn } //
+           $r{ "all_${allthing}_${vn}" };
 }
 
 sub target_kernkind_check ($) {