From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH OSSTEST v2 03/13] osstest migrate support check catch -> variables Date: Sun, 12 Jul 2015 17:20:26 +0100 Message-ID: <1436718036-7985-4-git-send-email-wei.liu2@citrix.com> References: <1436718036-7985-1-git-send-email-wei.liu2@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 1ZEK0F-0002kn-WD for xen-devel@lists.xenproject.org; Sun, 12 Jul 2015 16:21:20 +0000 In-Reply-To: <1436718036-7985-1-git-send-email-wei.liu2@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 Cc: Wei Liu , ian.jackson@eu.citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org From: Ian Jackson The goal here is to skip the following test steps if the check fails. Instead of using catch to turn an exception into value, we can just use spawn-ts and reap-ts to do that. This pattern is useful when we add in extra check for save / restore check later. Signed-off-by: Ian Jackson [ wei: write commit message ] Signed-off-by: Wei Liu --- sg-run-job | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sg-run-job b/sg-run-job index d53fd83..61f88fb 100755 --- a/sg-run-job +++ b/sg-run-job @@ -300,7 +300,9 @@ proc run-job/test-pair {} { } proc test-guest-migr {g} { - if {[catch { run-ts . = ts-migrate-support-check + host $g }]} return + set to_reap [spawn-ts . = ts-migrate-support-check + host $g] + set can_migrate [reap-ts $to_reap] + if {!$can_migrate} return foreach iteration {{} .2} { run-ts . =$iteration ts-guest-saverestore + host $g -- 1.9.1