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

[OSSTEST PATCH 28/82] host allocation: Support new reuse-* magic hostflag



From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

This is like share-* except it has different MaxTasks and MaxWear
parameters.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 README.planner              |  7 +++++++
 ts-hosts-allocate-Executive | 15 +++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/README.planner b/README.planner
index f134d716..a9275f12 100644
--- a/README.planner
+++ b/README.planner
@@ -230,6 +230,13 @@ hostflag:
     identically.  The osstest test harness revision is automatically
     appended and therefore does not need to be included.
 
+  reuse-SHARING
+
+    The host may be reused, one job after another.  Like share- but
+    only permits one job at a time, and has a much higher limit for
+    the number of successive jobs.  ts-host-test-share should be used
+    to arrange for the host's state to be recorded appropriately.
+
   equiv-FORMALTOKEN
 
     For each equiv-FORMALTOKEN job flag set on one or more IDENTs, a
diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index 2c18a739..6fcfd2e3 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -279,6 +279,16 @@ sub compute_hids () {
                     " $hid->{DefaultSharedMaxTasks}".
                     " $hid->{DefaultSharedMaxWear}\n";
                 next;
+            } elsif ($flag =~ m/^reuse-/) {
+                die if exists $hid->{Shared};
+                my $shr= $'; #'
+                $hid->{Shared}= $shr." ".get_harness_rev();
+                $hid->{SharedMaxTasks}= 1;
+               $hid->{SharedMaxWear}= 10;
+                print DEBUG "HID $ident FLAG $flag SHARE-REUSE $shr".
+                    " $hid->{SharedMaxTasks}".
+                    " $hid->{SharedMaxWear}\n";
+                next;
             } elsif ($flag =~ m/^equiv-/) {
                 my $formalclass= $'; #'
                 die if exists $hid->{Equiv};
@@ -484,6 +494,11 @@ END
         foreach my $kcomb (qw(Shared-Max-Wear Shared-Max-Tasks)) {
             my $kdb= $kcomb;  $kdb =~ y/-A-Z/ a-z/;
             my $khash= $kcomb;  $khash =~ y/-//d;
+           if ($hid->{$khash}) {
+               $candrow->{$khash} = $hid->{$khash};
+                print DEBUG "$dbg $khash FROM-HID\n";
+               next;
+           }
             $resprop_q->execute($candrow->{restype},$candrow->{resname},$kdb);
             my $proprow= $resprop_q->fetchrow_hashref();
             my $val= $proprow->{val};
-- 
2.20.1




 


Rackspace

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