]> git.proxmox.com Git - qemu.git/commit
create qemu_openpty_raw() helper function and move it to a separate file
authorMichael Tokarev <mjt@tls.msk.ru>
Wed, 5 Jun 2013 14:44:54 +0000 (18:44 +0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 14 Jun 2013 23:58:27 +0000 (18:58 -0500)
commit0817fa97673acc71994a65e73449b632c069c22b
tree062cab6849e28445a8b15fc5f16c40217627f441
parent58101748657072985a6a0e23f426be5426fd76f7
create qemu_openpty_raw() helper function and move it to a separate file

In two places qemu uses openpty() which is very system-dependent,
and in both places the pty is switched to raw mode as well.
Make a wrapper function which does both steps, and move all the
system-dependent complexity into a separate file, together
with static/local implementations of openpty() and cfmakeraw()
from qemu-char.c.

It is in a separate file, not part of oslib-posix.c, because
openpty() often resides in -lutil which is not linked to
every program qemu builds.

This change removes #including of <pty.h>, <termios.h>
and other rather specific system headers out of qemu-common.h,
which isn't a place for such specific headers really.

This version has been verified to build correctly on Linux,
OpenBSD, FreeBSD and OpenIndiana.  On the latter it lets qemu
to be built with gtk gui which were not possible there due to
missing openpty() and cfmakeraw().

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Andreas Färber <andreas.faerber@web.de>
(cherry picked from commit 4efeabbbe8441cc327052304976c7b9b86309d72)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
include/qemu-common.h
qemu-char.c
ui/gtk.c
util/Makefile.objs
util/qemu-openpty.c [new file with mode: 0644]