mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
QMP: Introduce basic asynchronous events
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 <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
0d1ea871b0
commit
b1a15e7eaa
3 changed files with 29 additions and 2 deletions
11
vl.c
11
vl.c
|
@ -4060,9 +4060,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;
|
||||
|
@ -4070,15 +4073,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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue