summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-07-20 12:07:30 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-07-20 12:08:40 +0100
commit8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55 (patch)
treea235fab6d2c11d0f2bc6aabfd425700d51130f1b
parent70daccfe4e9939078436c2830928d8e53432dd84 (diff)
downloadlibguestfs-8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55.tar.gz
libguestfs-8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55.tar.xz
libguestfs-8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55.zip
appliance: Capture stderr from qemu to the event system.
-rw-r--r--src/launch.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/launch.c b/src/launch.c
index a2a9beaa..c89c69f8 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]);
}