* [Qemu-devel] [5431] Allow the monitor to be suspended during non-blocking op
@ 2008-10-06 13:52 Anthony Liguori
2009-01-25 19:38 ` [Qemu-devel] " Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: Anthony Liguori @ 2008-10-06 13:52 UTC (permalink / raw)
To: qemu-devel
Revision: 5431
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5431
Author: aliguori
Date: 2008-10-06 13:52:44 +0000 (Mon, 06 Oct 2008)
Log Message:
-----------
Allow the monitor to be suspended during non-blocking op
Live migration happens in the background, but it is useful to make the monitor
command appear as if it's blocking. This allows a management tool to
immediately know when the live migration has completed without having to poll
the migration status.
This patch allows the monitor to be suspended from a monitor callback which
will prevent new monitor commands from being executed.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/console.h
trunk/monitor.c
Modified: trunk/console.h
===================================================================
--- trunk/console.h 2008-10-05 11:47:55 UTC (rev 5430)
+++ trunk/console.h 2008-10-06 13:52:44 UTC (rev 5431)
@@ -175,6 +175,8 @@
void term_print_help(void);
void monitor_readline(const char *prompt, int is_password,
char *buf, int buf_size);
+void monitor_suspend(void);
+void monitor_resume(void);
/* readline.c */
typedef void ReadLineFunc(void *opaque, const char *str);
Modified: trunk/monitor.c
===================================================================
--- trunk/monitor.c 2008-10-05 11:47:55 UTC (rev 5430)
+++ trunk/monitor.c 2008-10-06 13:52:44 UTC (rev 5431)
@@ -2694,12 +2694,29 @@
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)
{
readline_start("(qemu) ", 0, monitor_handle_command1, NULL);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [5431] Allow the monitor to be suspended during non-blocking op
2008-10-06 13:52 [Qemu-devel] [5431] Allow the monitor to be suspended during non-blocking op Anthony Liguori
@ 2009-01-25 19:38 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2009-01-25 19:38 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]
Anthony Liguori wrote:
> Revision: 5431
> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5431
> Author: aliguori
> Date: 2008-10-06 13:52:44 +0000 (Mon, 06 Oct 2008)
>
> Log Message:
> -----------
> Allow the monitor to be suspended during non-blocking op
>
> Live migration happens in the background, but it is useful to make the monitor
> command appear as if it's blocking. This allows a management tool to
> immediately know when the live migration has completed without having to poll
> the migration status.
>
> This patch allows the monitor to be suspended from a monitor callback which
> will prevent new monitor commands from being executed.
This is not true. The current code just prevents the command prompt from
being printed. Yeah, this subsystem is hairy. :)
I'm currently reworking the whole monitor infrastructure and could
either include a fix in my series to make this true suspension - or name
the interface after its effect: monitor_enable/disable_prompt().
So, what is the actually desired behavior?
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-25 19:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-06 13:52 [Qemu-devel] [5431] Allow the monitor to be suspended during non-blocking op Anthony Liguori
2009-01-25 19:38 ` [Qemu-devel] " Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).