]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: When save/restore helper dies, do not overwrite rc
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Jun 2015 18:22:41 +0000 (19:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Jun 2015 15:53:51 +0000 (16:53 +0100)
If we already have an rc (eg from ao abort), keep it.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
v4: New patch in this version of the series.

tools/libxl/libxl_save_callout.c

index 93a884bb7d911350490883f42bb00ff345fbc919..087c2d5f36efb6431ea3bda6617d8f942c6d58a3 100644 (file)
@@ -332,19 +332,22 @@ static void helper_exited(libxl__egc *egc, libxl__ev_child *ch,
 
     if (status) {
         libxl_report_child_exitstatus(CTX, XTL_ERROR, what, pid, status);
-        shs->rc = ERROR_FAIL;
+        if (!shs->rc)
+            shs->rc = ERROR_FAIL;
     }
 
     if (shs->need_results) {
-        if (!shs->rc)
+        if (!shs->rc) {
             LOG(ERROR,"%s exited without providing results",what);
-        shs->rc = ERROR_FAIL;
+            shs->rc = ERROR_FAIL;
+        }
     }
 
     if (!shs->completed) {
-        if (!shs->rc)
+        if (!shs->rc) {
             LOG(ERROR,"%s exited without signaling completion",what);
-        shs->rc = ERROR_FAIL;
+            shs->rc = ERROR_FAIL;
+        }
     }
 
     helper_done(egc, shs);