From 7f3081b528ce18d7feb0d0ee3b1bb612de3ff8ed Mon Sep 17 00:00:00 2001 From: Amit Shah <amit.shah@redhat.com> Date: Thu, 22 Jan 2009 15:15:31 +0530 Subject: [PATCH 32/54] qemu: Use async notification for guest reboot messages If "notify reboot on" is issued on the monitor, guest reboot events will be shown on the monitor, prefixed with the '#' character. [ Converted to async notifications from the original patch: commit 06b440abc15005a273be2604a6a8532f8b044733 Author: Dor Laor <dor.laor@qumranet.com> Date: Tue Jul 1 16:56:47 2008 +0300 Add reboot message for mgmt status tracking. ] Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Type: improvement RH-Upstream-status: pending --- qemu/console.h | 3 ++- qemu/monitor.c | 4 +++- qemu/vl.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qemu/console.h b/qemu/console.h index c8c95ec..398c8ec 100644 --- a/qemu/console.h +++ b/qemu/console.h @@ -192,7 +192,8 @@ extern uint8_t _translate_keycode(const int key); #define RTC_ASYNC_EVENT 2 #define SHUTDOWN_ASYNC_EVENT 3 #define MIGRATION_ASYNC_EVENT 4 -#define MAX_ASYNC_EVENTS MIGRATION_ASYNC_EVENT +#define REBOOT_ASYNC_EVENT 5 +#define MAX_ASYNC_EVENTS REBOOT_ASYNC_EVENT /* FIXME: term_printf et al should probably go elsewhere so everything does not need to include console.h */ diff --git a/qemu/monitor.c b/qemu/monitor.c index e80b70c..c71827c 100644 --- a/qemu/monitor.c +++ b/qemu/monitor.c @@ -255,6 +255,8 @@ static void do_notify_async_events(char *event_str, char *enable) event = SHUTDOWN_ASYNC_EVENT; else if (!strcmp(event_str, "migration")) event = MIGRATION_ASYNC_EVENT; + else if (!strcmp(event_str, "reboot")) + event = REBOOT_ASYNC_EVENT; else return; @@ -1613,7 +1615,7 @@ static term_cmd_t term_cmds[] = { { "set_qxl_log_level", "i", qxl_do_set_log_level, "", "set qxl log level" }, #endif { "notify", "ss", do_notify_async_events, - "vnc|rtc|shutdown|migration on|off", "enable / disable printing of notifications for the specified event" }, + "vnc|rtc|migration|reboot|shutdown on|off", "enable / disable printing of notifications for the specified event" }, { NULL, NULL, }, }; diff --git a/qemu/vl.c b/qemu/vl.c index 78a7fda..25c97d1 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -3649,6 +3649,7 @@ void qemu_system_reset_request(void) cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT); } main_loop_break(); + term_printf_async(REBOOT_ASYNC_EVENT, "GUEST: Got reboot request\n"); } void qemu_system_shutdown_request(void) -- 1.6.1