All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] PATCH: Put Psuedo-TTY in rawmode for char devices
Date: Sun, 4 May 2008 01:08:50 +0200	[thread overview]
Message-ID: <20080503230850.GA6745@volta.aurel32.net> (raw)
In-Reply-To: <20080501171424.GF21335@redhat.com>

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
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

  reply	other threads:[~2008-05-03 23:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22  0:50 [Qemu-devel] PATCH: Put Psuedo-TTY in rawmode for char devices Daniel P. Berrange
2008-05-01 17:14 ` Daniel P. Berrange
2008-05-03 23:08   ` Aurelien Jarno [this message]
2008-05-03 23:20     ` Samuel Thibault
2008-05-04 18:20     ` Daniel P. Berrange
2008-05-04 18:33       ` Samuel Thibault
2008-05-04 21:10         ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080503230850.GA6745@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.