]> xenbits.xensource.com Git - libvirt.git/commitdiff
virProcessRunInMountNamespace: Report errors from child
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 18 Jan 2017 09:56:14 +0000 (10:56 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Feb 2017 09:40:53 +0000 (10:40 +0100)
The comment to the function states that the errors from the child
process are reported. Well, the error buffer is filled with
possible error messages. But then it is thrown away. Among with
important error message from the child process.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virprocess.c

index f5c7ebb96f2d853eb635d53bee31ccde589c039e..16eb41212794cc7b405f599fab035989d295a43b 100644 (file)
@@ -1137,8 +1137,14 @@ virProcessRunInMountNamespace(pid_t pid,
         VIR_FORCE_CLOSE(errfd[1]);
         ignore_value(virFileReadHeaderFD(errfd[0], 1024, &buf));
         ret = virProcessWait(child, &status, false);
-        if (!ret)
+        if (!ret) {
             ret = status == EXIT_CANCELED ? -1 : status;
+            if (ret) {
+                virReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("child reported: %s"),
+                               NULLSTR(buf));
+            }
+        }
         VIR_FREE(buf);
     }