From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkDFr-00061C-6z for qemu-devel@nongnu.org; Wed, 05 Jun 2013 08:56:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkDFm-0000Bh-7H for qemu-devel@nongnu.org; Wed, 05 Jun 2013 08:55:55 -0400 Received: from speedy.comstyle.com ([2001:470:1d:8c::2]:28086 helo=mail.comstyle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkDFY-00006I-J6 for qemu-devel@nongnu.org; Wed, 05 Jun 2013 08:55:50 -0400 Message-ID: <51AF3193.5050009@comstyle.com> Date: Wed, 05 Jun 2013 08:39:47 -0400 From: Brad Smith 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; format=flowed Content-Transfer-Encoding: 7bit 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 On 05/06/13 6:28 AM, Michael Tokarev wrote: > Hello. > > One of old issues with compatibility between different > *Nix systems was the way how pty pairs were allocated. > > 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. > > Here it is, from qemu-char.c: > > #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) > {...} > > static void cfmakeraw (struct termios *termios_p) > {...} > #endif > > 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. > > Now, we have ui/gtk.c, which calls openpty() and cfmakeraw() > too, but this time, there's no compat alternative implementation > provided. > > Does this mean we don't need the old compat implementation > anymore? Does gtk ui work (or at least builds) on solaris? > > If gtk builds fine on solaris, it should be safe to remove > these static functions from qemu-char.c. > > 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. > > Thanks, > > /mjt Solaris does not have openpty() / cfmakeraw() functions so the Gtk+ front-end is broken there as well. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.