From: Ian Jackson Date: Mon, 7 Jun 2021 14:13:15 +0000 (+0100) Subject: host allocation: Check "job class" too X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=34a3d47095b17ea51424789c998525f99db0abd1;p=osstest.git host allocation: Check "job class" too That is all jobs which start with the same \w* as this job. Signed-off-by: Ian Jackson --- diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive index 9722ce1..849bc97 100755 --- a/ts-hosts-allocate-Executive +++ b/ts-hosts-allocate-Executive @@ -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; } }