From: tgingold@free.fr
To: Xen-devel <xen-devel@lists.xensource.com>
Subject: PATCH [xenconsoled]: makes pty slave raw early
Date: Wed, 16 Jan 2008 06:30:04 +0100 [thread overview]
Message-ID: <20080116053004.GA18526@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 342 bytes --]
Hi,
on my system (Linux 2.6.18.8 - ia64), if a domain write on the xencons
before xenconsole is initialized the domain gets back what it wrote.
This patch fixes this issue by making raw the pty slave very early.
(I suppose it doesn't happen with linux as a guest because it takes a little
bit of time before writing to xencons).
Tristan.
[-- Attachment #2: cons.patch --]
[-- Type: text/plain, Size: 1219 bytes --]
# HG changeset patch
# User Tristan Gingold <tgingold@free.fr>
# Date 1200461143 -3600
# Node ID 0353ead264baea1eac7fb35c622c69f45f3935df
# Parent ca2828a46217bec2096144d2bc96b1d610272f30
Make slave pty raw during initialization.
(This avoids echo).
Signed-off-by: Tristan Gingold <tgingold@free.fr>
diff -r ca2828a46217 -r 0353ead264ba tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Jan 16 06:21:50 2008 +0100
+++ b/tools/console/daemon/io.c Wed Jan 16 06:25:43 2008 +0100
@@ -278,8 +278,10 @@ static int openpty(int *amaster, int *as
if (winp)
ioctl(sfd, TIOCSWINSZ, winp);
+ if (termp)
+ tcsetattr(sfd, TCSAFLUSH, termp);
+
assert(name == NULL);
- assert(termp == NULL);
return 0;
@@ -299,11 +301,14 @@ static int domain_create_tty(struct doma
bool success;
char *data;
unsigned int len;
+ struct termios term;
assert(dom->slave_fd == -1);
assert(dom->master_fd == -1);
- if (openpty(&dom->master_fd, &dom->slave_fd, NULL, NULL, NULL) < 0) {
+ cfmakeraw(&term);
+
+ if (openpty(&dom->master_fd, &dom->slave_fd, NULL, &term, NULL) < 0) {
err = errno;
dolog(LOG_ERR, "Failed to create tty for domain-%d (errno = %i, %s)",
dom->domid, err, strerror(err));
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2008-01-16 5:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-16 5:30 tgingold [this message]
2008-01-16 10:57 ` PATCH [xenconsoled]: makes pty slave raw early Samuel Thibault
2008-01-16 12:20 ` John Levon
2008-01-16 13:20 ` Keir Fraser
2008-01-16 13:24 ` Samuel Thibault
2008-01-16 14:04 ` tgingold
2008-01-16 10:58 ` John Levon
2008-01-16 11:06 ` Samuel Thibault
2008-01-16 11:10 ` John Levon
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=20080116053004.GA18526@localhost.localdomain \
--to=tgingold@free.fr \
--cc=xen-devel@lists.xensource.com \
/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.