From: "Andreas Färber" <andreas.faerber@web.de>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel@nongnu.org, Brad Smith <brad@comstyle.com>
Subject: Re: [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 [thread overview]
Message-ID: <51B9FC8A.7000108@web.de> (raw)
In-Reply-To: <1371139489-31940-1-git-send-email-mjt@msgid.tls.msk.ru>
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 <mjt@tls.msk.ru>
> ---
> 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 <andreas.faerber@web.de>
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
prev parent reply other threads:[~2013-06-13 17:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 16:04 [Qemu-devel] [PATCH v3] create qemu_openpty_raw() helper function and move it to a separate file Michael Tokarev
2013-06-13 17:08 ` Andreas Färber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51B9FC8A.7000108@web.de \
--to=andreas.faerber@web.de \
--cc=aliguori@us.ibm.com \
--cc=brad@comstyle.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).