diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-07-20 12:07:30 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-07-27 14:50:30 +0100 |
commit | d222efeb15e830af7cdcdc273e3f7144856d38e8 (patch) | |
tree | 533be50d8f426878de2de08d6d80f1e72d22a0aa | |
parent | a21dff8faad086cce7c1a87cfa755a2e4f8eec8e (diff) | |
download | libguestfs-d222efeb15e830af7cdcdc273e3f7144856d38e8.tar.gz libguestfs-d222efeb15e830af7cdcdc273e3f7144856d38e8.tar.xz libguestfs-d222efeb15e830af7cdcdc273e3f7144856d38e8.zip |
appliance: Capture stderr from qemu to the event system.
(cherry picked from commit 8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55)
-rw-r--r-- | src/launch.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/launch.c b/src/launch.c index 58fb0d12..3e46e8f3 100644 --- a/src/launch.c +++ b/src/launch.c @@ -602,7 +602,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]); @@ -618,6 +618,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]); } |