Received: from eggs.gnu.org ([2001:4830:134:3::10]:37875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnB0w-00060o-Pf for qemu-devel@nongnu.org; Thu, 13 Jun 2013 13:08:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnB0u-0008K6-QX for qemu-devel@nongnu.org; Thu, 13 Jun 2013 13:08:46 -0400 Message-ID: <51B9FC8A.7000108@web.de> Date: Thu, 13 Jun 2013 19:08:26 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1371139489-31940-1-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1371139489-31940-1-git-send-email-mjt@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3] create qemu_openpty_raw() helper function and move it to a separate file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: qemu-trivial@nongnu.org, Anthony Liguori , qemu-devel@nongnu.org, Brad Smith 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 , > 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 > --- > Changes since v1: > > - added a forgotten #include 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 there too, > > - removed trailing newline Tested-by: Andreas Färber 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