X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Flaunch.c;h=c89c69f800714c5a5a643bc49334b790caa43361;hb=71eb0bf45649eefa1f0cd4b1372cfc2653c8e7a5;hp=1a47363d5f14e3e3aafd05c9ba6eb20c962019f7;hpb=f173543fd207bdc254a5eb75180d82ef25eacae9;p=libguestfs.git diff --git a/src/launch.c b/src/launch.c index 1a47363..c89c69f 100644 --- a/src/launch.c +++ b/src/launch.c @@ -625,17 +625,27 @@ 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]); close (rfd[0]); + /* Stdin. */ if (dup (wfd[0]) == -1) { dup_failed: perror ("dup failed"); _exit (EXIT_FAILURE); } + /* Stdout. */ + 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;