From: Ian Jackson Subject: [OSSTEST PATCH 26/29] Manual allocation: Provide JobInfo in mg-blockage Date: Mon, 7 Sep 2015 17:08:24 +0100 Message-ID: <1441642107-21826-27-git-send-email-ian.jackson@eu.citrix.com> References: <1441642107-21826-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZYzAL-0007Dp-IR for xen-devel@lists.xenproject.org; Mon, 07 Sep 2015 16:21:09 +0000 In-Reply-To: <1441642107-21826-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 Supply most of the information about our allocations in JobInfo, rather than Xinfo. And, correspondingly, rename all the variables `xinfo' to `info'. Supply only the supplied hostname as the Xinfo. This is slightly redundant but it does at least tell us what came out of the db. Signed-off-by: Ian Jackson --- v2: New patch --- mg-blockage | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mg-blockage b/mg-blockage index 0286c27..90547a5 100755 --- a/mg-blockage +++ b/mg-blockage @@ -14,7 +14,7 @@ csreadconfig(); die unless @ARGV==3 || @ARGV==4; die if $ARGV[0] =~ m/^=/; -our ($start,$end,$hostflag,$mxinfo) = @ARGV; +our ($start,$end,$hostflag,$minfo) = @ARGV; sub parsedate ($) { open D, "-|", qw(date +%s -d), @_ or die $!; @@ -24,13 +24,13 @@ sub parsedate ($) { return $r; } -my $basexinfo = manual_allocation_base_joinfo(); -my $xinfo = "blockage $basexinfo [$start .. $end]"; -$xinfo .= " $mxinfo" if defined $mxinfo; +my $baseinfo = manual_allocation_base_jobinfo(); +my $info = "blockage $baseinfo [$start .. $end]"; +$info .= " $minfo" if defined $minfo; $start = parsedate $start; $end = parsedate $end; -print $xinfo, "\n" or die $!; +print $info, "\n" or die $!; die unless $end > $start; @@ -38,7 +38,7 @@ sub min { (sort @_)[0]; } sub max { (reverse sort @_)[0]; } sub plan () { - alloc_resources(sub { + alloc_resources(JobInfo => $info, sub { my ($plan, $mayalloc) = @_; my $now = time; @@ -72,7 +72,7 @@ END foreach (my $ix=0; $ix<$avail; $ix++) { my $booking = { Reso => $res->{restype}.' '.$res->{resname}, - Xinfo => $xinfo, + Xinfo => $host, Start => $bookstart - $now, End => $bookend - $now, }; -- 1.7.10.4