From: Ian Jackson Subject: [OSSTEST PATCH 20/25] sg-report-host-history: Support flight:FLIGHT Date: Wed, 17 Jun 2015 17:45:16 +0100 Message-ID: <1434559521-8751-21-git-send-email-ian.jackson@eu.citrix.com> References: <1434559521-8751-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z5GT7-0004JS-D4 for xen-devel@lists.xenproject.org; Wed, 17 Jun 2015 16:45:41 +0000 In-Reply-To: <1434559521-8751-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- sg-report-host-history | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/sg-report-host-history b/sg-report-host-history index 8a4d40f..b3ef63e 100755 --- a/sg-report-host-history +++ b/sg-report-host-history @@ -162,6 +162,8 @@ END LIMIT 1 END + print DEBUG "QUERYING RUNVARS FOR $hostname\n"; + my @rows; $runvarq->execute($hostname); @@ -252,7 +254,25 @@ $dbh_tests->do("SET LOCAL enable_seqscan=false"); our %hosts; foreach my $host (@ARGV) { - $hosts{$host}++; + if ($host =~ m/^flight:/) { + my $flight=$'; #'; + db_retry($dbh_tests, [qw(flights)], sub { + our $hostsinflightq //= db_prepare(<execute($flight); + while (my $row = $hostsinflightq->fetchrow_hashref()) { + $hosts{$row->{val}}++; + } + }); + } elsif ($host !~ m/:/) { + $hosts{$host}++; + } else { + die "$host ?"; + } } foreach my $host (sort keys %hosts) { -- 1.7.10.4