pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/xentools3 On NetBSD, the pseudo-tty attribute...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/94e3de42fca8
branches:  trunk
changeset: 539572:94e3de42fca8
user:      bouyer <bouyer%pkgsrc.org@localhost>
date:      Sat Mar 08 13:59:39 2008 +0000

description:
On NetBSD, the pseudo-tty attributes are reset when the slave is open
for the first time. This cause a race between xenconsole and xenconsoled,
where the later start writing to the master pty before the former has
switched it back to raw, causing some lines to be echoed back to the
domU.
Fix this by keeping the slave open in xenconsoled, so that when xenconsole
opens it attributes are not reset. Hint provided by fvdl@, thanks !
Because of this we no longer need to set the slave to raw in xenconsole,
so shorten patch-cc.

Bump PKGREVISION.

diffstat:

 sysutils/xentools3/Makefile         |   4 +-
 sysutils/xentools3/distinfo         |   5 +-
 sysutils/xentools3/patches/patch-ca |  57 +++++++++++++++++++++++++++++++++++++
 sysutils/xentools3/patches/patch-cc |  10 +-----
 4 files changed, 63 insertions(+), 13 deletions(-)

diffs (118 lines):

diff -r fc985f46374e -r 94e3de42fca8 sysutils/xentools3/Makefile
--- a/sysutils/xentools3/Makefile       Sat Mar 08 13:58:09 2008 +0000
+++ b/sysutils/xentools3/Makefile       Sat Mar 08 13:59:39 2008 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.9 2008/03/03 17:11:19 xtraeme Exp $
+# $NetBSD: Makefile,v 1.10 2008/03/08 13:59:39 bouyer Exp $
 #
 
 VERSION=               3.1.3
 DISTNAME=              xen-${VERSION}-src
 PKGNAME=               xentools3-${VERSION}
-PKGREVISION=           1
+PKGREVISION=           2
 CATEGORIES=            sysutils
 MASTER_SITES=          ${MASTER_SITE_LOCAL}
 EXTRACT_SUFX=          .tgz
diff -r fc985f46374e -r 94e3de42fca8 sysutils/xentools3/distinfo
--- a/sysutils/xentools3/distinfo       Sat Mar 08 13:58:09 2008 +0000
+++ b/sysutils/xentools3/distinfo       Sat Mar 08 13:59:39 2008 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2008/03/03 16:45:27 hannken Exp $
+$NetBSD: distinfo,v 1.7 2008/03/08 13:59:39 bouyer Exp $
 
 SHA1 (xen-3.1.3-src.tgz) = 87b370df928feda599bbc7076e7a4589f67355c8
 RMD160 (xen-3.1.3-src.tgz) = b26b71e0422db7aece60aa4dd9f9c8d34affd0c7
@@ -25,8 +25,9 @@
 SHA1 (patch-bs) = e6542ccdad7b48536d2d1b0ad533da4b1a784022
 SHA1 (patch-bt) = d1cfab2ccf14d3df0fdda4c4699258997d2eb5d2
 SHA1 (patch-bw) = d4bdb0dcc48cabefb568042d3b58822f8251b1bd
+SHA1 (patch-ca) = f999e8159c79ae6cd09004b8cac4ca36da93f79f
 SHA1 (patch-cb) = 0bf2513749e28ff955caabd76bf79dd8280b61ed
-SHA1 (patch-cc) = 3e618c7da953115e7b3c7fe07f17b75ef2c2bb34
+SHA1 (patch-cc) = ffd67fd2c6ab21abd5afdbca893e35bb4bb3fa77
 SHA1 (patch-cd) = 8fc057e9dc98e356ba46cdf183a8891c59c005b8
 SHA1 (patch-cf) = 05c5e86d33d31a2216c2751a2bf684c8d5d06746
 SHA1 (patch-cg) = 36073c7327f187702203108b3e7596178aac3327
diff -r fc985f46374e -r 94e3de42fca8 sysutils/xentools3/patches/patch-ca
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xentools3/patches/patch-ca       Sat Mar 08 13:59:39 2008 +0000
@@ -0,0 +1,57 @@
+$NetBSD: patch-ca,v 1.1 2008/03/08 13:59:39 bouyer Exp $
+
+--- console/daemon/io.c.orig   2008-03-08 14:24:52.000000000 +0100
++++ console/daemon/io.c        2008-03-08 14:41:23.000000000 +0100
+@@ -56,6 +56,7 @@
+ {
+       int domid;
+       int tty_fd;
++      int stty_fd;
+       bool is_dead;
+       struct buffer buffer;
+       struct domain *next;
+@@ -160,6 +161,12 @@
+               char *data;
+               unsigned int len;
+ 
++              if ((dom->stty_fd = open(slave, O_RDONLY, 0)) == -1) {
++                      dolog(LOG_ERR, "Failed to open slave tty %s for "
++                          "domain-%d", slave, dom->domid);
++                      goto out;
++              }
++
+               if (tcgetattr(master, &term) != -1) {
+                       cfmakeraw(&term);
+                       tcsetattr(master, TCSAFLUSH, &term);
+@@ -444,6 +451,7 @@
+ {
+       if (d->tty_fd != -1) {
+               close(d->tty_fd);
++              close(d->stty_fd);
+               d->tty_fd = -1;
+       }
+ 
+@@ -527,6 +535,7 @@
+       len = read(dom->tty_fd, msg, len);
+       if (len < 1) {
+               close(dom->tty_fd);
++              close(dom->stty_fd);
+               dom->tty_fd = -1;
+ 
+               if (domain_is_valid(dom->domid)) {
+@@ -545,6 +554,7 @@
+               xc_evtchn_notify(dom->xce_handle, dom->local_port);
+       } else {
+               close(dom->tty_fd);
++              close(dom->stty_fd);
+               dom->tty_fd = -1;
+               shutdown_domain(dom);
+       }
+@@ -564,6 +574,7 @@
+                     dom->domid, len, errno);
+ 
+               close(dom->tty_fd);
++              close(dom->stty_fd);
+               dom->tty_fd = -1;
+ 
+               if (domain_is_valid(dom->domid)) {
diff -r fc985f46374e -r 94e3de42fca8 sysutils/xentools3/patches/patch-cc
--- a/sysutils/xentools3/patches/patch-cc       Sat Mar 08 13:58:09 2008 +0000
+++ b/sysutils/xentools3/patches/patch-cc       Sat Mar 08 13:59:39 2008 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-cc,v 1.1.1.1 2007/06/14 19:39:46 bouyer Exp $
+$NetBSD: patch-cc,v 1.2 2008/03/08 13:59:39 bouyer Exp $
 
 --- console/client/main.c.orig 2007-05-18 16:45:21.000000000 +0200
 +++ console/client/main.c      2007-05-27 14:43:14.000000000 +0200
@@ -14,11 +14,3 @@
  
  #include "xs.h"
  
-@@ -289,6 +293,7 @@
-               err(errno, "Could not read tty from store");
-       }
- 
-+      init_term(spty, &attr);
-       init_term(STDIN_FILENO, &attr);
-       console_loop(spty, xs, path);
-       restore_term(STDIN_FILENO, &attr);



Home | Main Index | Thread Index | Old Index