📄 patch-qemu-pty.diff
字号:
By default, with qemu version < 0.8.0 and with the command lineqemu -monitor pty or -serial pty, local echo isenabled for the qemu side of the pty. This can result in infinitewrite/read loops and/or slowness of the simulation. Attached is a verysmall patch (against today's cvs) solving the problem. The 3 linesadjusting the tty fields could be replaced by "cfmakeraw(&tty)" ifavailable on the host platform. -- David Decotigny (Dec 9 2005)Index: vl.c===================================================================RCS file: /cvsroot/qemu/qemu/vl.c,vretrieving revision 1.152diff -u -r1.152 vl.c--- vl.c 5 Dec 2005 20:31:52 -0000 1.152+++ vl.c 9 Dec 2005 15:07:46 -0000@@ -1396,6 +1396,7 @@ #if defined(__linux__) CharDriverState *qemu_chr_open_pty(void) {+ struct termios tty; char slave_name[1024]; int master_fd, slave_fd; @@ -1403,6 +1404,14 @@ if (openpty(&master_fd, &slave_fd, slave_name, NULL, NULL) < 0) { return NULL; }+ + /* Disabling local echo and line-buffered output */+ tcgetattr (master_fd, &tty);+ tty.c_lflag &= ~(ECHO|ICANON|ISIG);+ tty.c_cc[VMIN] = 1;+ tty.c_cc[VTIME] = 0;+ tcsetattr (master_fd, TCSAFLUSH, &tty);+ fprintf(stderr, "char device redirected to %s\n", slave_name); return qemu_chr_open_fd(master_fd, master_fd); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -