]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
ioemu: Fix serial console for HVM guests 3.3-testing
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 26 Oct 2009 13:36:51 +0000 (13:36 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 26 Oct 2009 13:36:51 +0000 (13:36 +0000)
Manpage states: "The cfmakeraw function sets the flags stored in the
termios structure (initialized by tcgetattr) to a state ... giving a
'raw I/O path'.

From: Manuel Bouyer <bouyer@netbsd.org>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
tools/ioemu/vl.c

index 00507282d48e5565b797e910f87b10233733939b..0e485d7d0b4248da78f1c5408af2f441652be8f3 100644 (file)
@@ -1914,8 +1914,11 @@ static CharDriverState *qemu_chr_open_pty(void)
     }
     
     /* Set raw attributes on the pty. */
+    if (tcgetattr(master_fd, &tty) < 0)
+        perror("tcgetattr failed");
     cfmakeraw(&tty);
-    tcsetattr(slave_fd, TCSAFLUSH, &tty);
+    if (tcsetattr(slave_fd, TCSAFLUSH, &tty) < 0)
+        perror("tcsetattr failed");
 
     fprintf(stderr, "char device redirected to %s\n", ptsname(master_fd));