WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.2-testing] xenconsoled: Make slave pty raw during

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.2-testing] xenconsoled: Make slave pty raw during initialization.
From: "Xen patchbot-3.2-testing" <patchbot-3.2-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Jan 2008 09:50:43 -0800
Delivery-date: Wed, 16 Jan 2008 09:50:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1200491187 0
# Node ID 1fd763a71bb8004e2b89fbf419fc88e164e9584d
# Parent  aa18252cae0ab7b2546a431b51af14b8de01c49f
xenconsoled: Make slave pty raw during initialization.
(This avoids echo).

Signed-off-by: Tristan Gingold <tgingold@xxxxxxx>
xen-unstable changeset:   16726:ec3f90599ab1cd7d25088fd5de411c8c4d75755a
xen-unstable date:        Wed Jan 16 13:44:18 2008 +0000
---
 tools/console/daemon/io.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff -r aa18252cae0a -r 1fd763a71bb8 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Tue Jan 15 19:01:06 2008 +0000
+++ b/tools/console/daemon/io.c Wed Jan 16 13:46:27 2008 +0000
@@ -246,7 +246,6 @@ static void domain_close_tty(struct doma
 }
 
 #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)
 {
@@ -278,8 +277,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;
 
@@ -289,7 +290,20 @@ err:
        close(mfd);
        return -1;
 }
-#endif
+
+void cfmakeraw(struct termios *termios_p)
+{
+       termios_p->c_iflag &=
+           ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+       termios_p->c_oflag &= ~OPOST;
+       termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+       termios_p->c_cflag &= ~(CSIZE|PARENB);
+       termios_p->c_cflag |= CS8;
+
+       termios_p->c_cc[VMIN] = 0;
+       termios_p->c_cc[VTIME] = 0;
+}
+#endif /* __sun__ */
 
 static int domain_create_tty(struct domain *dom)
 {
@@ -299,11 +313,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));

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.2-testing] xenconsoled: Make slave pty raw during initialization., Xen patchbot-3.2-testing <=