From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CH6yR-0006Wz-35 for qemu-devel@nongnu.org; Mon, 11 Oct 2004 16:40:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CH6yQ-0006Vj-21 for qemu-devel@nongnu.org; Mon, 11 Oct 2004 16:40:50 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CH6yJ-0006Uv-52 for qemu-devel@nongnu.org; Mon, 11 Oct 2004 16:40:43 -0400 Received: from [151.189.21.44] (helo=mail-in-01.arcor-online.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CH6qW-0001QO-0y for qemu-devel@nongnu.org; Mon, 11 Oct 2004 16:32:40 -0400 Received: from rih.NotaMusica.com (dsl-084-057-048-195.arcor-ip.net [84.57.48.195]) by mail-in-01.arcor-online.net (Postfix) with ESMTP id D613F44D30 for ; Mon, 11 Oct 2004 22:32:37 +0200 (CEST) Received: from halef.NotaMusica.com (halef.NotaMusica.com [192.168.1.2]) by rih.NotaMusica.com (8.12.3/8.12.3/Debian-7.1) with ESMTP id i9BKWaK4028384 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL) for ; Mon, 11 Oct 2004 22:32:36 +0200 Received: from halef.NotaMusica.com (localhost [127.0.0.1]) by halef.NotaMusica.com (8.12.3/8.12.3/Debian-7.1) with ESMTP id i9BKWZcT002877 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 11 Oct 2004 22:32:35 +0200 Received: from localhost (jmartin@localhost) by halef.NotaMusica.com (8.12.3/8.12.3/Debian-7.1) with ESMTP id i9BKWUsP002872 for ; Mon, 11 Oct 2004 22:32:35 +0200 Date: Mon, 11 Oct 2004 22:32:29 +0200 (CEST) From: Johannes Martin Subject: Re: [Qemu-devel] new feature: attach a process to emulated serial port In-Reply-To: <2ad73a0410110822151a58fc@mail.gmail.com> Message-ID: References: <20041011142629.C1087@edinburgh.cisco.com> <2ad73a0410110822151a58fc@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, wow - I didn't think my patch would cause so much controversy :) On Mon, 11 Oct 2004, Derek Fawcus wrote: > > The attached patch adds another variety of the -serial and -monitor > > options. You can now use > > -serial "exec:any shell command" > > to redirect the input/output of named shell command to the guest's se= rial > > port. > > Hmm. How about simply using FIFO's instead, then one doesn't have any > issues with fork/system/etc > > i.e. add options of -serialin -serialout and have -serial= > set both of the above. Then one can simply do: > > mkfifo /tmp/serin /tmp/serout > anycmd < /tmp/serout > /tmp/serin & > qemu ... -serialin /tmp/serin -serialout /tmp/serialout Actually, that's kind of what I tried before (-serial stdio, with stdin/stdout redirected to a pipe). However, some programs don't like that. Most importantly, slirp doesn't work with it - it seems to expect a real tty. I like my solution because 1. we don't need another command line argument but only extend an existin= g one 2. we don't create another library dependency (forkpty is declared in pty.h just as openpty is which we use for -serial pty) 3. I don't need to bother about communicating pty (or pipe) names between processes 4. programs like slirp and pppd work just fine with this approach On Mon, 11 Oct 2004, Andr=E9 Braga wrote: > That would make this feature available only on operating systems that > support user-created named pipes. IOW, named pipes do exist on Windows, > but they're not easy to access by the user. > > Forking is a more universal approach, as I see it. Sorry if I have to disappoint: I'm not sure whether the forkpty() call is available in Windoze. The -serial pty code is disabled for a Windows compile, so I did the same for my -serial exec code. If there's a windows guru out there who knows whether ptys are emulated in cygwin maybe you ca= n test whether it will work in windoze as well. Johannes