NetBSD-Bugs archive

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

Re: port-xen/40675: Xen 3.3: guest serial console not functional



The following reply was made to PR port-xen/40675; it has been noted by GNATS.

From: Juergen Hannken-Illjes <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: Christoph_Egger%gmx.de@localhost
Subject: Re: port-xen/40675: Xen 3.3: guest serial console not functional
Date: Fri, 20 Feb 2009 13:17:31 +0100

 You could try the attached diff ...
 
 Using uninitialized data for cfmakeraw->openpty results in pty attributes
 that may even have the receiver disabled.
 
 -- 
 Juergen Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig 
(Germany)
 
 $NetBSD: $
 --- console/daemon/io.c.orig   2008-08-22 09:49:07.000000000 +0000
 +++ console/daemon/io.c
 @@ -403,7 +403,5 @@ static int domain_create_tty(struct doma
        assert(dom->master_fd == -1);
  
 -      cfmakeraw(&term);
 -
 -      if (openpty(&dom->master_fd, &dom->slave_fd, NULL, &term, NULL) < 0) {
 +      if (openpty(&dom->master_fd, &dom->slave_fd, NULL, NULL, NULL) < 0) {
                err = errno;
                dolog(LOG_ERR, "Failed to create tty for domain-%d "
 @@ -413,4 +411,20 @@ static int domain_create_tty(struct doma
        }
  
 +      if (tcgetattr(dom->slave_fd, &term) < 0) {
 +              err = errno;
 +              dolog(LOG_ERR, "Failed to get tty attributes for domain-%d "
 +                      "(errno = %i, %s)",
 +                      dom->domid, err, strerror(err));
 +              goto out;
 +      }
 +      cfmakeraw(&term);
 +      if (tcsetattr(dom->slave_fd, TCSANOW, &term) < 0) {
 +              err = errno;
 +              dolog(LOG_ERR, "Failed to set tty attributes for domain-%d "
 +                      "(errno = %i, %s)",
 +                      dom->domid, err, strerror(err));
 +              goto out;
 +      }
 +
        if ((slave = ptsname(dom->master_fd)) == NULL) {
                err = errno;
 


Home | Main Index | Thread Index | Old Index