From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: [OSSTEST PATCH] ts-hosts-allocate-Executive: Do not allocate specific host with wrong blessing
Date: Tue, 29 Sep 2015 15:14:38 +0100 [thread overview]
Message-ID: <1443536078-23449-1-git-send-email-ian.jackson@eu.citrix.com> (raw)
If the job contains a runvar specifying a specific host, still check
that host's blessing. Otherwise bisections can run on unblessed
hosts. They should fail instead.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
ts-hosts-allocate-Executive | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index dd9fcf2..88da504 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -279,26 +279,26 @@ sub hid_find_possibilities ($) {
my $use= $hid->{OverrideUse} || $r{ $hid->{Ident} };
- my $findhostsq;
- if (defined $use) {
- print DEBUG "HID $hid->{Ident} USE $use\n";
- $findhostsq= $dbh_tests->prepare(<<END);
- SELECT *
- FROM resources
- WHERE restype=? AND resname=? AND shareix=0
-END
- $findhostsq->execute('host',$use);
- } else {
- print DEBUG "HID $hid->{Ident} INTENDED $fi->{intended}\n";
- $findhostsq= $dbh_tests->prepare(<<END);
+ print DEBUG "HID $hid->{Ident} INTENDED $fi->{intended}\n";
+ my $findhostsq = <<END;
SELECT *
FROM resources JOIN hostflags
ON (restype='host' AND shareix=0 AND
resname=hostname AND hostflag=?)
END
- $findhostsq->execute("blessed-$fi->{intended}");
+ my @findhostsqvars = ("blessed-$fi->{intended}");
+
+ if (defined $use) {
+ print DEBUG "HID $hid->{Ident} USE $use\n";
+ $findhostsq .= <<END;
+ WHERE restype='host' AND resname=? AND shareix=0
+END
+ push @findhostsqvars, $use;
}
+ $findhostsq= $dbh_tests->prepare($findhostsq);
+ $findhostsq->execute(@findhostsqvars);
+
my $equivstatusq= $dbh_tests->prepare(<<END);
SELECT flight, job, val, status
FROM flights f
@@ -423,7 +423,7 @@ END
if (!@candidates) {
if (defined $use) {
- logm("specified host $use for $hid->{Ident} nonexistent?");
+ logm("specified host $use for $hid->{Ident} nonexistent or unblessed?");
} else {
logm("no suitable host for $hid->{Ident} (out of $any)");
}
--
1.7.10.4
next reply other threads:[~2015-09-29 14:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 14:14 Ian Jackson [this message]
2015-09-29 14:30 ` [OSSTEST PATCH] ts-hosts-allocate-Executive: Do not allocate specific host with wrong blessing Ian Campbell
2015-09-29 16:34 ` Ian Jackson
2015-09-29 15:27 ` [OSSTEST PATCH 2/1] ts-hosts-allocate-Executive: Finish a couple of transactions Ian Jackson
2015-09-29 15:27 ` [OSSTEST PATCH 3/1] ts-hosts-allocate-Executive: Print more info about booking to main log Ian Jackson
2015-09-29 16:08 ` Ian Campbell
2015-09-29 16:28 ` Ian Jackson
2015-09-29 16:03 ` [OSSTEST PATCH 2/1] ts-hosts-allocate-Executive: Finish a couple of transactions Ian Campbell
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=1443536078-23449-1-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=ian.campbell@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).