From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 06/13] Planner: client side: New `!OK think noalloc' protocol Date: Wed, 2 Sep 2015 16:45:12 +0100 Message-ID: <1441208719-31336-7-git-send-email-ian.jackson@eu.citrix.com> References: <1441208719-31336-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 1ZXAJX-00026f-Ul for xen-devel@lists.xenproject.org; Wed, 02 Sep 2015 15:51:08 +0000 In-Reply-To: <1441208719-31336-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 Introduce a way for the queue daemon to tell its client that it must not allocate anything in this planning iteration. In the client: * Advertise the new feature via set-info. * Accept the `noalloc' part of `!OK think noalloc'; * Print that in our log message; * Honour it by passing it to $resourcecall. And document the new protocol. However, there is no server-side yet, so this does not yet introduce any overall change to the system. Signed-off-by: Ian Jackson --- Osstest/Executive.pm | 9 ++++++--- README.planner | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index f9be0a0..4f51d70 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -674,6 +674,7 @@ sub alloc_resources { $set_info->('priority', $priority); $set_info->('sub-priority',$ENV{OSSTEST_RESOURCE_SUBPRIORITY}); $set_info->('preinfo', $ENV{OSSTEST_RESOURCE_PREINFO}); + $set_info->('feature-noalloc', 1); if (defined $waitstart) { $set_info->('wait-start',$waitstart); @@ -699,7 +700,9 @@ sub alloc_resources { logm("resource allocation: awaiting our slot..."); - $_= <$qserv>; defined && m/^\!OK think\s$/ or die "$_ ?"; + $_= <$qserv>; + defined && m/^\!OK think( noalloc)?\s$/ or die "$_ ?"; + my $noalloc = $1 // ''; opendb_tests(); @@ -715,12 +718,12 @@ sub alloc_resources { read($qserv, $jplan, $jplanlen) == $jplanlen or die $!; my $jplanprint= $jplan; chomp $jplanprint; - logm("resource allocation: obtained base plan."); + logm("resource allocation: obtained base plan$noalloc."); $debugm->("base plan = ", $jplanprint); $plan= from_json($jplan); }, sub { if (!eval { - ($ok, $bookinglist) = $resourcecall->($plan, 1); + ($ok, $bookinglist) = $resourcecall->($plan, !$noalloc); 1; }) { warn "resourcecall $@"; diff --git a/README.planner b/README.planner index b1247e7..24185ce 100644 --- a/README.planner +++ b/README.planner @@ -194,11 +194,15 @@ ms-queuedaemon commands > set-info sub-priority ... } queue adjustment > set-info wait-start-adjust ... } + > set-info feature-noalloc 1 + The client understands `!OK think noalloc'. + > wait I want to join the plan - < !OK think + < !OK think [noalloc] Now is the time to add yourself to the plan + `noalloc' means client must not not actually allocate. > get-plan < OK get-plan BYTES -- 1.7.10.4