From: Keir Fraser Date: Mon, 26 Oct 2009 13:36:51 +0000 (+0000) Subject: ioemu: Fix serial console for HVM guests X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fheads%2F3.3-testing;p=people%2Fvhanquez%2Fxen.git ioemu: Fix serial console for HVM guests 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 Signed-off-by: Christoph Egger --- diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c index 00507282d..0e485d7d0 100644 --- a/tools/ioemu/vl.c +++ b/tools/ioemu/vl.c @@ -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));