@@ -2471,10 +2471,18 @@ sub target_var_prefix ($) {
sub target_var ($$) {
my ($ho,$vn) = @_;
- my $pfx = target_var_prefix($ho);
- my $allthing = exists $ho->{Guest} ? "guest" : "host";
- return $r{ $pfx. $vn } //
- $r{ "all_${allthing}_${vn}" };
+ my @prefixes;
+ push @prefixes, target_var_prefix($ho);
+ if (exists $ho->{Guest}) {
+ push @prefixes, 'all_guest_';
+ } else {
+ push @prefixes, 'all_host_';
+ }
+ foreach my $prefix (@prefixes) {
+ my $v = $r{ $prefix.$vn };
+ return $v if defined $v;
+ }
+ return undef;
}
sub target_kernkind_check ($) {
Make an explicit list of the prefixes and a loop to walk over them. No functional change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> --- Osstest/TestSupport.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)