[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v3 03/13] osstest migrate support check catch -> variables



From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

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 <ian.jackson@xxxxxxxxxxxxx>
[ wei: write commit message ]
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.