From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 2/4] ts-hosts-allocate-Executive: add a label to loop over candidates Date: Wed, 16 Sep 2015 12:47:42 +0100 Message-ID: <1442404064-16192-2-git-send-email-ian.campbell@citrix.com> References: <1442404047.18856.51.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442404047.18856.51.camel@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: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org I'm going to want to "next CANDIDATE" from within a nested loop. Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- ts-hosts-allocate-Executive | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive index c9aae88..294395d 100755 --- a/ts-hosts-allocate-Executive +++ b/ts-hosts-allocate-Executive @@ -313,6 +313,7 @@ END my @candidates; my $any=0; + CANDIDATE: while (my $candrow= $findhostsq->fetchrow_hashref()) { $candrow->{Warnings}= [ ]; $candrow->{Reso}= "$candrow->{restype} $candrow->{resname}"; @@ -343,7 +344,7 @@ END my $erow= $equivflagscheckq->fetchrow_hashref(); if (!$erow) { print DEBUG "$dbg EQUIV $equiv->{FormalClass} NO-CLASSES\n"; - next; + next CANDIDATE; } my $eq= $erow->{hostflag}; print DEBUG "$dbg EQUIV $equiv->{FormalClass} MAYBE $eq\n"; @@ -358,7 +359,7 @@ END print DEBUG "$dbg FLAGS MISSINGFLAGS: @missingflags.\n"; if (@missingflags) { - next unless defined $use; + next CANDIDATE unless defined $use; push @{ $candrow->{Warnings} }, "specified host lacks flags @missingflags"; } -- 2.5.1