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] Fix serial pty creation in qemu-dm. Set raw attributes t

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix serial pty creation in qemu-dm. Set raw attributes to
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 30 Nov 2005 13:20:08 +0000
Delivery-date: Wed, 30 Nov 2005 13:20:35 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 590915af81172ecaeab2f7fdcd640eb41aa89456
# Parent  73d19afe543c271ec61169a224b007537b4be4cd
Fix serial pty creation in qemu-dm. Set raw attributes to
avoid weird buffering behaviour and obtain the pty name
via ptsname().

Signed-off-by: Ping Yu <ping.y.yu@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 73d19afe543c -r 590915af8117 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Wed Nov 30 11:16:35 2005
+++ b/tools/ioemu/vl.c  Wed Nov 30 11:32:16 2005
@@ -1176,7 +1176,6 @@
 int store_console_dev(int domid, char *pts)
 {
     int xc_handle;
-    unsigned int len = 0;
     struct xs_handle *xs;
     char *path;
 
@@ -1218,15 +1217,19 @@
 #if defined(__linux__)
 CharDriverState *qemu_chr_open_pty(void)
 {
-    char slave_name[1024];
     int master_fd, slave_fd;
-
-    /* Not satisfying */
-    if (openpty(&master_fd, &slave_fd, slave_name, NULL, NULL) < 0) {
+    struct termios term;
+
+    if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) < 0)
         return NULL;
-    }
-    fprintf(stderr, "char device redirected to %s\n", slave_name);
-    store_console_dev(domid, slave_name);
+
+    /* Set raw attributes on the pty. */
+    cfmakeraw(&term);
+    tcsetattr(slave_fd, TCSAFLUSH, &term);
+
+    fprintf(stderr, "char device redirected to %s\n", ptsname(slave_fd));
+    store_console_dev(domid, ptsname(slave_fd));
+
     return qemu_chr_open_fd(master_fd, master_fd);
 }
 #else

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix serial pty creation in qemu-dm. Set raw attributes to, Xen patchbot -unstable <=