fish: Add fish-cmds.h to generator_built.
[libguestfs.git] / src / launch.c
index 58fb0d1..4981d6f 100644 (file)
@@ -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]);
     }
@@ -657,7 +665,7 @@ launch_appliance (guestfs_h *g)
       pid_t parent_pid = getppid ();
 
       /* Writing to argv is hideously complicated and error prone.  See:
-       * http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/ps_status.c?rev=1.33.2.1;content-type=text%2Fplain
+       * http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/misc/ps_status.c;hb=HEAD
        */
 
       /* Loop around waiting for one or both of the other processes to