summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Capitulino2012-08-09 16:27:30 +0200
committerLuiz Capitulino2012-08-13 21:10:18 +0200
commit17c8660b0b2be17d389e2ffd5681d535cc0d8912 (patch)
tree1877932eddf8841012d90a621124844d694c07a6
parentqmp: don't emit the RESET event on wakeup from S3 (diff)
downloadqemu-17c8660b0b2be17d389e2ffd5681d535cc0d8912.tar.gz
qemu-17c8660b0b2be17d389e2ffd5681d535cc0d8912.tar.xz
qemu-17c8660b0b2be17d389e2ffd5681d535cc0d8912.zip
qmp: emit the WAKEUP event when the guest is put to run
Today, the WAKEUP event is emitted when a wakeup _request_ is made. This could be the system_wakeup command, for example. A better semantic would be to emit the event when the guest is already running, as that's what matters in the end. This commit does that change. In theory, this could break compatibility. In practice, it shouldn't happen though, as clients shouldn't rely on timing characteristics of the events. That is, a client relying that the guest is not running when the event arrives may break if the event arrives after the guest is already running. This commit also adds the missing documentation for the WAKEUP event. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--QMP/qmp-events.txt13
-rw-r--r--vl.c2
2 files changed, 14 insertions, 1 deletions
diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
index 9ba7079589..10f69d1906 100644
--- a/QMP/qmp-events.txt
+++ b/QMP/qmp-events.txt
@@ -264,6 +264,19 @@ Example:
}}
+WAKEUP
+------
+
+Emitted when the guest has woken up from S3 and is running.
+
+Data: None.
+
+Example:
+
+{ "event": "WATCHDOG",
+ "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
+
+
WATCHDOG
--------
diff --git a/vl.c b/vl.c
index 68fa0a060f..97ab39ff6e 100644
--- a/vl.c
+++ b/vl.c
@@ -1465,7 +1465,6 @@ void qemu_system_wakeup_request(WakeupReason reason)
return;
}
runstate_set(RUN_STATE_RUNNING);
- monitor_protocol_event(QEVENT_WAKEUP, NULL);
notifier_list_notify(&wakeup_notifiers, &reason);
wakeup_requested = 1;
qemu_notify_event();
@@ -1552,6 +1551,7 @@ static bool main_loop_should_exit(void)
cpu_synchronize_all_states();
qemu_system_reset(VMRESET_SILENT);
resume_all_vcpus();
+ monitor_protocol_event(QEVENT_WAKEUP, NULL);
}
if (qemu_powerdown_requested()) {
monitor_protocol_event(QEVENT_POWERDOWN, NULL);