[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 37/48] qmp: don't emit the RESET event on wakeup fro
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 37/48] qmp: don't emit the RESET event on wakeup from S3 |
Date: |
Mon, 13 Aug 2012 16:48:58 -0300 |
QEMU is basically using reset logic when waking up from S3. This
causes the QMP RESET event to be emitted, which is wrong. Also,
the runstate checks done in reset are not necessary for S3 wakeup.
Fix this by untangling wakeup from reset logic and passing
VMRESET_SILENT to qemu_system_reset() to avoid emitting the RESET
event.
Signed-off-by: Luiz Capitulino <address@hidden>
Acked-by: Gerd Hoffmann <address@hidden>
---
vl.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 91076f0..68fa0a0 100644
--- a/vl.c
+++ b/vl.c
@@ -1298,6 +1298,7 @@ static pid_t shutdown_pid;
static int powerdown_requested;
static int debug_requested;
static int suspend_requested;
+static int wakeup_requested;
static NotifierList suspend_notifiers =
NOTIFIER_LIST_INITIALIZER(suspend_notifiers);
static NotifierList wakeup_notifiers =
@@ -1352,6 +1353,13 @@ static int qemu_suspend_requested(void)
return r;
}
+static int qemu_wakeup_requested(void)
+{
+ int r = wakeup_requested;
+ wakeup_requested = 0;
+ return r;
+}
+
int qemu_powerdown_requested(void)
{
int r = powerdown_requested;
@@ -1459,7 +1467,7 @@ void qemu_system_wakeup_request(WakeupReason reason)
runstate_set(RUN_STATE_RUNNING);
monitor_protocol_event(QEVENT_WAKEUP, NULL);
notifier_list_notify(&wakeup_notifiers, &reason);
- reset_requested = 1;
+ wakeup_requested = 1;
qemu_notify_event();
}
@@ -1539,6 +1547,12 @@ static bool main_loop_should_exit(void)
runstate_set(RUN_STATE_PAUSED);
}
}
+ if (qemu_wakeup_requested()) {
+ pause_all_vcpus();
+ cpu_synchronize_all_states();
+ qemu_system_reset(VMRESET_SILENT);
+ resume_all_vcpus();
+ }
if (qemu_powerdown_requested()) {
monitor_protocol_event(QEVENT_POWERDOWN, NULL);
qemu_irq_raise(qemu_system_powerdown);
--
1.7.11.2.249.g31c7954.dirty
- [Qemu-devel] [PATCH 20/48] qapi: generate correct enum names for camel case enums, (continued)
- [Qemu-devel] [PATCH 20/48] qapi: generate correct enum names for camel case enums, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 19/48] qapi: qapi-types.h: don't include qapi/qapi-types-core.h, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 18/48] hmp: hmp.h: include qdict.h, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 22/48] qapi-schema: add ErrorClass enum, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 28/48] error: drop unused functions, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 33/48] qerror: drop qerror_table and qerror_format(), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 34/48] error, qerror: drop QDict member, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 35/48] docs: writing-qmp-commands.txt: update error section, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 36/48] scripts: qapi-commands.py: qmp-commands.h: include qdict.h, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 38/48] qmp: emit the WAKEUP event when the guest is put to run, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 37/48] qmp: don't emit the RESET event on wakeup from S3,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 42/48] qmp: introduce device-list-properties command, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 43/48] qapi: mark QOM commands stable, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 26/48] error: add error_get_class(), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 29/48] qmp: switch to the new error format on the wire, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 21/48] qapi: don't convert enum strings to lowercase, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 25/48] qerror: add proper ErrorClass value for QERR_ macros, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 48/48] target-ppc: add implementation of query-cpu-definitions (v2), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 24/48] error, qerror: add ErrorClass argument to error functions, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 47/48] target-i386: add implementation of query-cpu-definitions (v2), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 31/48] error: drop error_get_qobject()/error_set_qobject(), Luiz Capitulino, 2012/08/13