]> git.proxmox.com Git - mirror_qemu.git/blobdiff - monitor.c
Allow the monitor to be suspended during non-blocking op
[mirror_qemu.git] / monitor.c
index 4f51eccdcade54c824a0b2e9c2ec24b398f66b75..dd2e770e685728d677e32569527c5ba1ac872378 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -2694,10 +2694,27 @@ static void term_read(void *opaque, const uint8_t *buf, int size)
         readline_handle_byte(buf[i]);
 }
 
+static int monitor_suspended;
+
 static void monitor_handle_command1(void *opaque, const char *cmdline)
 {
     monitor_handle_command(cmdline);
-    monitor_start_input();
+    if (!monitor_suspended)
+        monitor_start_input();
+    else
+        monitor_suspended = 2;
+}
+
+void monitor_suspend(void)
+{
+    monitor_suspended = 1;
+}
+
+void monitor_resume(void)
+{
+    if (monitor_suspended == 2)
+        monitor_start_input();
+    monitor_suspended = 0;
 }
 
 static void monitor_start_input(void)