summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-24 13:06:13 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-24 13:06:13 +0100
commit089a39486f2c47994c6c0d34ac7abf34baf40d9d (patch)
tree07bf9220989162df8d29b99568d13ce6d5261822 /vl.c
parent27acb9dd2407f41550e453b85aa5ebf1bd618b79 (diff)
parentd622cb5879ca8006d5482158e4e3b272a068c301 (diff)
downloadqemu-089a39486f2c47994c6c0d34ac7abf34baf40d9d.tar.gz
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp: (43 commits) monitor: protect event emission monitor: protect outbuf and mux_out with mutex qemu-char: make writes thread-safe qemu-char: move pty_chr_update_read_handler around qemu-char: do not call chr_write directly qemu-char: introduce qemu_chr_alloc qapi event: clean up qapi event: convert QUORUM events qapi event: convert GUEST_PANICKED qapi event: convert BALLOON_CHANGE qmp: convert ACPI_DEVICE_OST event qapi event: convert SPICE events qapi event: convert VNC events qapi event: convert NIC_RX_FILTER_CHANGED qapi event: convert other BLOCK_JOB events qapi event: convert BLOCK_IMAGE_CORRUPTED qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR qapi event: convert DEVICE_TRAY_MOVED qapi event: convert DEVICE_DELETED qapi event: convert WATCHDOG ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
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 063966a091..3c2ce059d9 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();