From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkBoK-0004Mw-QK for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:23:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkBoI-0000Zn-Bl for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:23:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56332 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkBoI-0000Zc-58 for qemu-devel@nongnu.org; Wed, 05 Jun 2013 07:23:22 -0400 Message-ID: <51AF1FA3.2010605@suse.de> Date: Wed, 05 Jun 2013 13:23:15 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <51AF12BF.6080600@msgid.tls.msk.ru> In-Reply-To: <51AF12BF.6080600@msgid.tls.msk.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] qemu & openpty List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: Paolo Bonzini , Anthony Liguori , qemu-devel Am 05.06.2013 12:28, schrieb Michael Tokarev: > Hello. >=20 > One of old issues with compatibility between different > *Nix systems was the way how pty pairs were allocated. >=20 > And qemu have a twist in #includes, depending on which > platform it is run, and quite some compat cruft in > qemu-char.c about this issue. >=20 > Here it is, from qemu-char.c: >=20 > #ifdef __sun__ > /* Once Solaris has openpty(), this is going to be removed. */ > static int openpty(int *amaster, int *aslave, char *name, > struct termios *termp, struct winsize *winp) > {...} >=20 > static void cfmakeraw (struct termios *termios_p) > {...} > #endif >=20 > and later on, openpty() is used in the code. Note that > both functions are marked as static - static to the > source file, qemu-char.c. >=20 > Now, we have ui/gtk.c, which calls openpty() and cfmakeraw() > too, but this time, there's no compat alternative implementation > provided. >=20 > Does this mean we don't need the old compat implementation > anymore? Does gtk ui work (or at least builds) on solaris? I haven't tried yet, but this sounds like something for osdep.c, no need for a special qemu-openpty.c. Andreas >=20 > If gtk builds fine on solaris, it should be safe to remove > these static functions from qemu-char.c. >=20 > If not, we should obviously re-use these for ui/gtk.c -- > for which I'd create a new file, say, qemu-openpty.c, > with all the system-dependent stuff inside, and create > a wrapper function, qemu_openpty(), to do the work, > and, ofcourse, remove and other fancy stuff > (like for solaris) from qemu-common.h (!!!) > where it finally ended up. >=20 > Thanks, >=20 > /mjt >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg