aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/vl.c b/vl.c
index 063966a..3c2ce05 100644
--- a/vl.c
+++ b/vl.c
@@ -116,6 +116,8 @@ int main(int argc, char **argv)
#include "ui/qemu-spice.h"
#include "qapi/string-input-visitor.h"
#include "qapi/opts-visitor.h"
+#include "qom/object_interfaces.h"
+#include "qapi-event.h"
#define DEFAULT_RAM_SIZE 128
@@ -737,7 +739,7 @@ void vm_start(void)
* the STOP event.
*/
if (runstate_is_running()) {
- monitor_protocol_event(QEVENT_STOP, NULL);
+ qapi_event_send_stop(&error_abort);
} else {
cpu_enable_ticks();
runstate_set(RUN_STATE_RUNNING);
@@ -745,7 +747,7 @@ void vm_start(void)
resume_all_vcpus();
}
- monitor_protocol_event(QEVENT_RESUME, NULL);
+ qapi_event_send_resume(&error_abort);
}
@@ -789,15 +791,6 @@ int qemu_timedate_diff(struct tm *tm)
return seconds - time(NULL);
}
-void rtc_change_mon_event(struct tm *tm)
-{
- QObject *data;
-
- data = qobject_from_jsonf("{ 'offset': %d }", qemu_timedate_diff(tm));
- monitor_protocol_event(QEVENT_RTC_CHANGE, data);
- qobject_decref(data);
-}
-
static void configure_rtc_date_offset(const char *startdate, int legacy)
{
time_t rtc_start_date;
@@ -1849,7 +1842,7 @@ void qemu_system_reset(bool report)
qemu_devices_reset();
}
if (report) {
- monitor_protocol_event(QEVENT_RESET, NULL);
+ qapi_event_send_reset(&error_abort);
}
cpu_synchronize_all_post_reset();
}
@@ -1870,7 +1863,7 @@ static void qemu_system_suspend(void)
pause_all_vcpus();
notifier_list_notify(&suspend_notifiers, NULL);
runstate_set(RUN_STATE_SUSPENDED);
- monitor_protocol_event(QEVENT_SUSPEND, NULL);
+ qapi_event_send_suspend(&error_abort);
}
void qemu_system_suspend_request(void)
@@ -1933,7 +1926,7 @@ void qemu_system_shutdown_request(void)
static void qemu_system_powerdown(void)
{
- monitor_protocol_event(QEVENT_POWERDOWN, NULL);
+ qapi_event_send_powerdown(&error_abort);
notifier_list_notify(&powerdown_notifiers, NULL);
}
@@ -1965,7 +1958,7 @@ static bool main_loop_should_exit(void)
}
if (qemu_shutdown_requested()) {
qemu_kill_report();
- monitor_protocol_event(QEVENT_SHUTDOWN, NULL);
+ qapi_event_send_shutdown(&error_abort);
if (no_shutdown) {
vm_stop(RUN_STATE_SHUTDOWN);
} else {
@@ -1988,7 +1981,7 @@ static bool main_loop_should_exit(void)
notifier_list_notify(&wakeup_notifiers, &wakeup_reason);
wakeup_reason = QEMU_WAKEUP_REASON_NONE;
resume_all_vcpus();
- monitor_protocol_event(QEVENT_WAKEUP, NULL);
+ qapi_event_send_wakeup(&error_abort);
}
if (qemu_powerdown_requested()) {
qemu_system_powerdown();