[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/20] QMP: Introduce basic asynchronous events
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 14/20] QMP: Introduce basic asynchronous events |
Date: |
Thu, 26 Nov 2009 22:59:04 -0200 |
Debug, shutdown, reset, powerdown and stop are all basic events,
as they are very simple they can be added in the same commit.
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 15 +++++++++++++++
monitor.h | 5 +++++
vl.c | 11 +++++++++--
3 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/monitor.c b/monitor.c
index a555f12..89115a6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -342,6 +342,21 @@ void monitor_protocol_event(MonitorEvent event, QObject
*data)
return;
switch (event) {
+ case EVENT_DEBUG:
+ event_name = "DEBUG";
+ break;
+ case EVENT_SHUTDOWN:
+ event_name = "SHUTDOWN";
+ break;
+ case EVENT_RESET:
+ event_name = "RESET";
+ break;
+ case EVENT_POWERDOWN:
+ event_name = "POWERDOWN";
+ break;
+ case EVENT_STOP:
+ event_name = "STOP";
+ break;
default:
abort();
break;
diff --git a/monitor.h b/monitor.h
index a1d8b7a..851fd33 100644
--- a/monitor.h
+++ b/monitor.h
@@ -15,6 +15,11 @@ extern Monitor *cur_mon;
/* QMP events */
typedef enum MonitorEvent {
+ EVENT_DEBUG,
+ EVENT_SHUTDOWN,
+ EVENT_RESET,
+ EVENT_POWERDOWN,
+ EVENT_STOP,
EVENT_MAX,
} MonitorEvent;
diff --git a/vl.c b/vl.c
index dd9b74b..6c709d0 100644
--- a/vl.c
+++ b/vl.c
@@ -4110,9 +4110,12 @@ static void main_loop(void)
#endif
} while (vm_can_run());
- if (qemu_debug_requested())
+ if (qemu_debug_requested()) {
+ monitor_protocol_event(EVENT_DEBUG, NULL);
vm_stop(EXCP_DEBUG);
+ }
if (qemu_shutdown_requested()) {
+ monitor_protocol_event(EVENT_SHUTDOWN, NULL);
if (no_shutdown) {
vm_stop(0);
no_shutdown = 0;
@@ -4120,15 +4123,19 @@ static void main_loop(void)
break;
}
if (qemu_reset_requested()) {
+ monitor_protocol_event(EVENT_RESET, NULL);
pause_all_vcpus();
qemu_system_reset();
resume_all_vcpus();
}
if (qemu_powerdown_requested()) {
+ monitor_protocol_event(EVENT_POWERDOWN, NULL);
qemu_irq_raise(qemu_system_powerdown);
}
- if ((r = qemu_vmstop_requested()))
+ if ((r = qemu_vmstop_requested())) {
+ monitor_protocol_event(EVENT_STOP, NULL);
vm_stop(r);
+ }
}
pause_all_vcpus();
}
--
1.6.6.rc0.50.gaf06e
- [Qemu-devel] [PATCH 04/20] monitor: Introduce monitor_find_command(), (continued)
- [Qemu-devel] [PATCH 04/20] monitor: Introduce monitor_find_command(), Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 05/20] monitor: Rename monitor_handle_command(), Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 06/20] monitor: Introduce 'info commands', Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 07/20] QError: Add errors needed by QMP, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 08/20] QMP: Initial support, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 09/20] QMP: Output support, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 10/20] QMP: do_info() checks, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 11/20] QMP: Input support, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 12/20] QMP: Allow 'query-' commands, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 13/20] QMP: Asynchronous events infrastructure, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 14/20] QMP: Introduce basic asynchronous events,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 15/20] QMP: Disable monitor print functions, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 16/20] QMP: Introduce README file, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 17/20] QMP: Introduce specification, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 18/20] QMP: Introduce qmp-events.txt, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 19/20] QMP: Introduce qmp-shell, Luiz Capitulino, 2009/11/26
- [Qemu-devel] [PATCH 20/20] QMP: Introduce vm-info, Luiz Capitulino, 2009/11/26