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

[Xen-devel] [OSSTEST PATCH 18/26] power: power_reboot_attempts: Honour an $approach_re



The semantics are slightly different here: not specifying it means to
try everything rather than only the hardest.  But the effect is
similar: not specifying $approach_re means we must succeed.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 96ddbc3c..4e1192d4 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -978,8 +978,8 @@ sub power_cycle_host_setup ($) {
     $ho->{PowerApproaches} = \@approaches;
 }
 
-sub power_reboot_attempts ($$$) {
-    my ($ho, $setup, $await) = @_;
+sub power_reboot_attempts ($$$;$) {
+    my ($ho, $setup, $await, $approach_re) = @_;
     # Power cycles $ho, calling $setup->() while it is (supposedly) off.
     # Then, just after turning $ho on, calls $await->().
     # If $await->() succeeds, great: returns.
@@ -997,6 +997,7 @@ sub power_reboot_attempts ($$$) {
        MethObjs => power_cycle_parse_method($ho, 'ssh'),
     };
     foreach my $approach ($ssh, @{ $ho->{PowerApproaches} }) {
+       next if defined $approach_re && $approach->{Name} !~ qr{$approach_re};
        logm("power: trying to reboot $ho->{Name} (using $approach->{Name})");
        if (eval {
            power_approach_invoke($ho, $approach, 0);
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.