]> xenbits.xensource.com Git - osstest.git/commitdiff
host allocation: Check "job class" too
authorIan Jackson <iwj@xenproject.org>
Mon, 7 Jun 2021 14:13:15 +0000 (15:13 +0100)
committerIan Jackson <iwj@xenproject.org>
Mon, 7 Jun 2021 15:14:47 +0000 (16:14 +0100)
That is all jobs which start with the same \w* as this job.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
ts-hosts-allocate-Executive

index 9722ce127ad6fa7960529c01acee87f4da8761ea..849bc97b37e8e4154bf0bfee0cb63a75080f6880 100755 (executable)
@@ -937,12 +937,20 @@ sub attempt_allocation {
            }
        } elsif (%$starvation_p) {
            my $est_abs = most_optimistic($best, $now, $starvation_p->{I});
-           my ($starving, $m) = starving($est_abs, $now, 0);
+           my $all_starving = 1;
+           foreach my $thisclass (qw(1 0)) {
+               my $tcdesc = $thisclass ? 'class' : 'flight';
+               my ($starving, $m) = starving($est_abs, $now, $thisclass);
+               if (!$starving) {
+                   print DEBUG "not starving ($tcdesc): $m\n";
+                   $all_starving = 0;
+                   last;
+               } else {
+                   logm "starving ($tcdesc) ($m)";
+               }
+           }
            $starvation_q->finish();
-           if (!$starving) {
-               print DEBUG "not starving: $m\n";
-           } else {
-               logm "starving ($m)";
+           if ($all_starving) {
                return $alloc_starved_r;
            }
        }