From: Richard W.M. Jones Date: Wed, 20 Jul 2011 11:07:30 +0000 (+0100) Subject: appliance: Capture stderr from qemu to the event system. X-Git-Tag: 1.10.6~11 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=7141850a2ca8094f91c709cbdcb8dd0e094a6d18;p=libguestfs.git appliance: Capture stderr from qemu to the event system. (cherry picked from commit 8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55) --- diff --git a/src/launch.c b/src/launch.c index a4dc98f..e9a1741 100644 --- a/src/launch.c +++ b/src/launch.c @@ -625,7 +625,7 @@ launch_appliance (guestfs_h *g) guestfs___print_timestamped_argv (g, (const char **)g->cmdline); if (!g->direct) { - /* Set up stdin, stdout. */ + /* Set up stdin, stdout, stderr. */ close (0); close (1); close (wfd[1]); @@ -641,6 +641,14 @@ launch_appliance (guestfs_h *g) if (dup (rfd[1]) == -1) goto dup_failed; + /* Particularly since qemu 0.15, qemu spews all sorts of debug + * information on stderr. It is useful to both capture this and + * not confuse casual users, so send stderr to the pipe as well. + */ + close (2); + if (dup (rfd[1]) == -1) + goto dup_failed; + close (wfd[0]); close (rfd[1]); }