From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkDNk-00048o-Gu for qemu-devel@nongnu.org; Wed, 05 Jun 2013 09:04:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkDNh-0003YX-6i for qemu-devel@nongnu.org; Wed, 05 Jun 2013 09:04:04 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:44201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkDNh-0003YA-0f for qemu-devel@nongnu.org; Wed, 05 Jun 2013 09:04:01 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Jun 2013 09:04:00 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 955D36E804C for ; Wed, 5 Jun 2013 09:03:52 -0400 (EDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r55D3qH8256026 for ; Wed, 5 Jun 2013 09:03:52 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r55D3jL4031947 for ; Wed, 5 Jun 2013 07:03:45 -0600 From: Anthony Liguori In-Reply-To: <51AF12BF.6080600@msgid.tls.msk.ru> References: <51AF12BF.6080600@msgid.tls.msk.ru> Date: Wed, 05 Jun 2013 08:03:37 -0500 Message-ID: <87y5ao4sly.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] qemu & openpty List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: Paolo Bonzini , qemu-devel Michael Tokarev writes: > 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 This code is gross. > 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? I didn't carry this code over to the GTK UI because 1) I have no way to test it 2) it adds a lot of complexity for something that may be used by noone. > If gtk builds fine on solaris, it should be safe to remove > these static functions from qemu-char.c. I think we're quickly getting to a point where we should simply state that in order for any OS to be "supported" by QEMU, there must be a buildbot. Otherwise the testing burden is too high. I'll send a top-level note with such a proposal. Regards, Anthony Liguori > 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