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

[OSSTEST PATCH 34/82] plan_search: Track last sharing state to determine $share_reuse



From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

What matters for the purpose of $share_reuse is not whether the host
is actually being _shared_ (ie, there are other concurrent allocations
and therefore a concurrent Event with Share information).  What we
really want to know is whether the *last* use of this host was a
suitable sharing setup - because we actually want to know if we will
be able to skip our setup.

So track that explicitly.  (The slightly odd structure, where there
are two loops in one, means that we reset $last_eshare when we go onto
the next $req ie the next host to check.)

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/Executive.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index 4083ae6b..5f59c44e 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -676,6 +676,7 @@ sub plan_search ($$$$) {
     my $try_time= 0;
     my $confirmedok= 0;
     my $share_reuse= 0;
+    my $last_eshare;
 
     for (;;) {
        my $req= $requestlist->[$reqix];
@@ -715,6 +716,10 @@ sub plan_search ($$$$) {
             # this period is entirely after the proposed slot;
             # so no need to check this or any later periods
 
+           $last_eshare = $startevt->{
+                $startevt->{Type} eq 'Unshare' ? 'PreviousShare' : 'Share'
+                                     };
+
            next PERIOD if $endevt->{Time} <= $try_time;
             # this period is entirely before the proposed slot;
             # it doesn't overlap, but must check subsequent periods
@@ -743,9 +748,10 @@ sub plan_search ($$$$) {
            " try=$try_time confirmed=$confirmedok reuse=$share_reuse");
 
        $confirmedok++;
-       $share_reuse++ if defined $share_wear;
+       $share_reuse++ if $last_eshare and $share_compat_ok->($last_eshare);
        $reqix++;
        $reqix %= @$requestlist;
+       undef $last_eshare;
        last if $confirmedok==@$requestlist;
     }
 
-- 
2.20.1




 


Rackspace

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