From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 1/4] host allocation: Support -B<blessing> option
Date: Tue, 4 Oct 2016 18:17:41 +0000 [thread overview]
Message-ID: <1475605064-18326-1-git-send-email-ian.jackson@eu.citrix.com> (raw)
The flight's intended affects the hostflags required, the duration
searches, and other decisions. It is particularly useful for
debugging, where it can be desirable to try replaying a production
job's allocation with a "play" job.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
ts-hosts-allocate-Executive | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index 706ab6d..7c32847 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -31,12 +31,15 @@ open DEBUG, ">/dev/null" or die $!;
our $compressdebug=1;
our $fake; # never allocate
+our $blessing;
while (@ARGV and $ARGV[0] =~ m/^-/) {
$_= shift @ARGV;
last if m/^--$/;
while (m/^-./) {
- if (s/^-U/-/) {
+ if (s/^-B(.*)/-/) {
+ $blessing=$1; # default is flight's intended blessing
+ } elsif (s/^-U/-/) {
$compressdebug=0;
} elsif (s/^-n/-/) {
$fake=1;
@@ -84,7 +87,9 @@ sub setup () {
SELECT * FROM flights
WHERE flight = ?
END
- logm("flight $flight intended $fi->{intended} branch $fi->{branch}");
+
+ $blessing //= $fi->{intended};
+ logm("flight $flight intended $blessing branch $fi->{branch}");
$jobinfo= $dbh_tests->selectrow_hashref(<<END, {}, $flight, $job);
SELECT * FROM jobs
@@ -121,7 +126,7 @@ END
AND hostflag LIKE 'equiv-%'
END
- $duration_estimator= duration_estimator($fi->{branch}, $fi->{intended},
+ $duration_estimator= duration_estimator($fi->{branch}, $blessing,
sub { print DEBUG "@_\n"; });
$resprop_q= $dbh_tests->prepare(<<END);
@@ -284,14 +289,14 @@ sub hid_find_possibilities ($$) {
my $use= $hid->{OverrideUse} || $r{ $hid->{Ident} };
- print DEBUG "HID $hid->{Ident} INTENDED $fi->{intended}\n";
+ print DEBUG "HID $hid->{Ident} INTENDED $blessing\n";
my $findhostsq = <<END;
SELECT *
FROM resources JOIN hostflags
ON (restype='host' AND shareix=0 AND
resname=hostname AND hostflag=?)
END
- my @findhostsqvars = ("blessed-$fi->{intended}");
+ my @findhostsqvars = ("blessed-$blessing");
if (defined $use) {
print DEBUG "HID $hid->{Ident} USE $use\n";
@@ -431,7 +436,7 @@ END
find_recent_duration($dbg,$hid,$candrow);
if ($candrow->{restype} eq 'host') {
- $equivstatusq->execute($job,$fi->{intended},$fi->{branch},
+ $equivstatusq->execute($job,$blessing,$fi->{branch},
$hid->{Ident},$candrow->{resname});
my $esrow = $equivstatusq->fetchrow_hashref();
$candrow->{EquivMostRecentStatus} = $esrow->{status};
--
1.7.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next reply other threads:[~2016-10-04 18:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-04 18:17 Ian Jackson [this message]
2016-10-04 18:17 ` [OSSTEST PATCH 2/4] host allocation: Pass a debug function in find_recent_duration Ian Jackson
2016-10-04 18:17 ` [OSSTEST PATCH 3/4] host allocation: Dedupe "other hosts" flights in duration estimation Ian Jackson
2016-10-04 18:17 ` [OSSTEST PATCH 4/4] host allocation: Fix duration estimate to not include host allocation Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475605064-18326-1-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).