libxl: spawn: Always debug log middle child process death
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Jun 2015 17:10:51 +0000 (18:10 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Jun 2015 15:53:51 +0000 (16:53 +0100)
Otherwise the debug log is strangely devoid of an explanation for the
spawn completing.

We decorate `what', as otherwise the logged message is rather alarming
(especially if the death is due to us sending SIGKILL, which even
happens on the success path).

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_exec.c

index 85cbde05cb8c601c4c8550bc4c0673583d5febf7..ecb30cfbaedb4cb6b935728d3742b913271a8076 100644 (file)
@@ -411,6 +411,8 @@ static void spawn_middle_death(libxl__egc *egc, libxl__ev_child *childw,
         ((WIFEXITED(status) && WEXITSTATUS(status)==0) ||
          (WIFSIGNALED(status) && WTERMSIG(status)==SIGKILL))) {
         /* as expected */
+        const char *what = GCSPRINTF("%s (dying as expected)", ss->what);
+        libxl_report_child_exitstatus(CTX, XTL_DEBUG, what, pid, status);
     } else if (!WIFEXITED(status)) {
         int loglevel = ss->detaching ? XTL_WARN : XTL_ERROR;
         const char *what =