qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] char: disable stdio echo on resume from suspend


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH] char: disable stdio echo on resume from suspend.
Date: Tue, 06 Jan 2015 15:33:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 01/05/2015 11:21 AM, Gal Hammer wrote:
The monitor's auto-completion feature stopped working when stdio is used
as an input and qemu was resumed after it was suspended (using ctrl-z).

Thanks Gal, it works now!

Tested-by: Marcel Apfelbaum <address@hidden>


Signed-off-by: Gal Hammer <address@hidden>
---
  qemu-char.c | 11 +++++++++++
  1 file changed, 11 insertions(+)

diff --git a/qemu-char.c b/qemu-char.c
index ef84b53..786df33 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1113,12 +1113,22 @@ static int old_fd0_flags;
  static bool stdio_in_use;
  static bool stdio_allow_signal;

+static void qemu_chr_set_echo_stdio(CharDriverState *chr, bool echo);
+
  static void term_exit(void)
  {
      tcsetattr (0, TCSANOW, &oldtty);
      fcntl(0, F_SETFL, old_fd0_flags);
  }

+static void term_stdio_handler(int sig)
+{
+    if (sig == SIGCONT) {
+        /* echo should be off after resume from suspend. */
+        qemu_chr_set_echo_stdio(NULL, false);
+    }
+}
+
  static void qemu_chr_set_echo_stdio(CharDriverState *chr, bool echo)
  {
      struct termios tty;
@@ -1165,6 +1175,7 @@ static CharDriverState *qemu_chr_open_stdio(ChardevStdio 
*opts)
      tcgetattr(0, &oldtty);
      qemu_set_nonblock(0);
      atexit(term_exit);
+    signal(SIGCONT, term_stdio_handler);

      chr = qemu_chr_open_fd(0, 1);
      chr->chr_close = qemu_chr_close_stdio;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]