peripherals: 0.896 performance: 0.878 graphic: 0.860 device: 0.835 semantic: 0.707 files: 0.706 mistranslation: 0.669 architecture: 0.651 user-level: 0.633 network: 0.583 ppc: 0.576 PID: 0.560 boot: 0.546 permissions: 0.534 kernel: 0.529 register: 0.464 hypervisor: 0.454 socket: 0.448 KVM: 0.411 VMM: 0.409 x86: 0.408 arm: 0.388 i386: 0.385 vnc: 0.375 virtual: 0.355 debug: 0.353 TCG: 0.319 risc-v: 0.311 assembly: 0.246 ENH: Inherit ptys, useful output from -serial pty When controlling a qemu instance from another program, it'd be very useful to be able to have qemu inherit pseudo-tty file descriptors so they could just be specified on the command line. It's possible to allocate a pty pair in the master program before forking and exec'ing qemu and have qemu use that pty, but it's a bit painful. The master program must call ptsname(...) on the fd of the slave side and insert the path to the pty device node into qemu's command line. This doesn't work well in many scripting languages which lack a ptsname() call; a Linux-specific hack like readlink() of /proc/self/fd/[slave-fd] is necessary. If qemu accepted file descriptors for serial I/O this would all be a lot more flexible, and it wouldn't be limited to ptys either. Just accept a new format for "-serial" like "-serial fd:7" and have the parent program not set that FD to close-on-exec. None of this would be as necessary if qemu's "-serial pty" option was fully functional. Unfortunately, it doesn't provide any information to associate the created PTY(s) with their qemu devices, so it's hard to know which serial port is which, which the monitor device is, etc. See, eg: $ qemu -serial pty -serial pty -monitor pty char device redirected to /dev/pts/6 char device redirected to /dev/pts/7 char device redirected to /dev/pts/8 ... which is which? Are they allocated in the order they're specified on the command line? Nope, because /dev/pts/6 is the monitor in this case. With more than one device using "pty" a lot of guesswork is involved. If you're using "-monitor stdio" you can issue an "info chardev" and parse that to find out what everything else is connected to, but this shouldn't really be necessary. Ideally the device names would be printed when a port is redirected to a pty, eg: $ qemu -serial pty -serial pty -monitor pty char device compat_monitor0 redirected to /dev/pts/6 char device serial0 redirected to /dev/pts/7 char device serial1 redirected to /dev/pts/8 Looks like a fix for this has been included here: http://git.qemu.org/?p=qemu.git;a=commitdiff;h=586502189edf9fd0f89a83d ... so I think it should be OK to close this ticket now.