[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] PATCH: Put Psuedo-TTY in rawmode for char devices

From: Aurelien Jarno
Subject: Re: [Qemu-devel] PATCH: Put Psuedo-TTY in rawmode for char devices
Date: Sun, 4 May 2008 01:08:50 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

On Thu, May 01, 2008 at 06:14:24PM +0100, Daniel P. Berrange wrote:
> Re-posting patch for review/inclusion...
> On Tue, Apr 22, 2008 at 01:50:57AM +0100, Daniel P. Berrange wrote:
> > If running a QEMU instance with a serial/parallel device connected to a
> > Psuedo-TTY, eg  '-serial pty',  every \r\n sequence output by the guest
> > is getting translated into a \n\n sequence by the TTY layer. So clients
> > interacting with the serial port via a TTY done get the correct \r\n
> > sequence and text marches to the right and wraps. This is because the 
> > TTY is not put into rawmode when QEMU sets it up. 
> > 
> > The following patch is a re-diff of a patch applied to Xen's QEMU code.
> > It uses cfmakeraw() to ensure the TTY is put into rawmode, thus avoiding
> > the incorrect \r\n translations. It also switches to tcsetattr() on the
> > slave_fd instead of master_fd - although this is effectively the same on
> > Linux, only slave_fd works on Solaris. Finally it stops using the 'name'
> > arg to openpty() which is a security risk because its buffer size is
> > undefined. Instead it makes use of the ptsname() function.

cfmakeraw() is Linux specific, though also available on most BSD
systems. It is unavailable on Solaris, and probably the same on WIN32.

  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   address@hidden         | address@hidden
   `-    people.debian.org/~aurel32 | www.aurel32.net

reply via email to

[Prev in Thread] Current Thread [Next in Thread]