Skip to contentSkip to conversation

Restore terminal monitor attributes - addition

PATCH Applied Shahar Havivi 2 participants 2 messages Mar 14, 2010 – Mar 31, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Restore terminal monitor attributes - addition

Patch 2d753894c7553d6a05e8fdbed5f4704398919a35 was missing this check, when running monitor as /dev/tty and other serial device, i.e:
qemu -monitor /dev/tty -serial /dev/pts/1

Without this patch any serial device will override the monitor stored attributes. (monitor is called in main() before any serial device).

---
 qemu-char.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
qemu-char.c +3 -1
index 0e25ef3..4bf1e82 100644
@@ -1002,7 +1002,9 @@ static void tty_serial_init(int fd, int speed,
            speed, parity, data_bits, stop_bits);
 #endif
     tcgetattr (fd, &tty);
-    oldtty = tty;
+    if (!term_atexit_done) {
+        oldtty = tty;
+    }
 
 #define check_speed(val) if (speed <= val) { spd = B##val; break; }
     speed = speed * 10 / 11;
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 9 lines · Shahar Havivi

Patch 2d753894c7553d6a05e8fdbed5f4704398919a35 was missing this check, when running monitor as /dev/tty and other serial device, i.e:
qemu -monitor /dev/tty -serial /dev/pts/1

Without this patch any serial device will override the monitor stored attributes. (monitor is called in main() before any serial device).

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 20 lines
---
  qemu-char.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
qemu-char.c +3 -1
index 0e25ef3..4bf1e82 100644
@@ -1002,7 +1002,9 @@ static void tty_serial_init(int fd, int speed,
             speed, parity, data_bits, stop_bits);
  #endif
      tcgetattr (fd,&tty);
-    oldtty = tty;
+    if (!term_atexit_done) {
+        oldtty = tty;
+    }
 
  #define check_speed(val) if (speed<= val) { spd = B##val; break; }
      speed = speed * 10 / 11;