qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH v3] create qemu_openpty_raw() hel


From: Andreas Färber
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v3] create qemu_openpty_raw() helper function and move it to a separate file
Date: Thu, 13 Jun 2013 19:08:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Am 13.06.2013 18:04, schrieb Michael Tokarev:
> 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 <address@hidden>
> ---
> Changes since v1:
> 
> - added a forgotten #include <termios.h> for *BSD,
>   which was recently added into qemu-common.h by
>   Brad Smith, and which I intended to use in
>   qemu-openpty.c too, but somehow forgot.
> 
> Changes since v2:
> 
> - verified build on solaris (openindiana) and added
>   #include <termios.h> there too,
> 
> - removed trailing newline

Tested-by: Andreas Färber <address@hidden>

on OpenIndiana 151a.

Thanks,
Andreas

> This is trivial enough to warrant a -trivial tree.
> The diffstat below is large because of the comments
> in the new file.
> 
>  include/qemu-common.h |   15 +-----
>  qemu-char.c           |   77 ++--------------------------
>  ui/gtk.c              |   12 ++---
>  util/Makefile.objs    |    2 +-
>  util/qemu-openpty.c   |  135 
> +++++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 146 insertions(+), 95 deletions(-)
>  create mode 100644 util/qemu-openpty.c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]