From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, kraxel@redhat.com, mdroth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 4/4] vl: drop is_suspended variable
Date: Mon, 7 May 2012 10:56:55 -0300 [thread overview]
Message-ID: <1336399015-11269-5-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1336399015-11269-1-git-send-email-lcapitulino@redhat.com>
Check for the RUN_STATE_SUSPENDED state instead.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
vl.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/vl.c b/vl.c
index a7afc79..5e0080b 100644
--- a/vl.c
+++ b/vl.c
@@ -1293,7 +1293,6 @@ static pid_t shutdown_pid;
static int powerdown_requested;
static int debug_requested;
static int suspend_requested;
-static bool is_suspended;
static NotifierList suspend_notifiers =
NOTIFIER_LIST_INITIALIZER(suspend_notifiers);
static NotifierList wakeup_notifiers =
@@ -1427,12 +1426,11 @@ static void qemu_system_suspend(void)
notifier_list_notify(&suspend_notifiers, NULL);
runstate_set(RUN_STATE_SUSPENDED);
monitor_protocol_event(QEVENT_SUSPEND, NULL);
- is_suspended = true;
}
void qemu_system_suspend_request(void)
{
- if (is_suspended) {
+ if (runstate_check(RUN_STATE_SUSPENDED)) {
return;
}
suspend_requested = 1;
@@ -1447,7 +1445,7 @@ void qemu_register_suspend_notifier(Notifier *notifier)
void qemu_system_wakeup_request(WakeupReason reason)
{
- if (!is_suspended) {
+ if (!runstate_check(RUN_STATE_SUSPENDED)) {
return;
}
if (!(wakeup_reason_mask & (1 << reason))) {
@@ -1458,7 +1456,6 @@ void qemu_system_wakeup_request(WakeupReason reason)
notifier_list_notify(&wakeup_notifiers, &reason);
reset_requested = 1;
qemu_notify_event();
- is_suspended = false;
}
void qemu_system_wakeup_enable(WakeupReason reason, bool enabled)
--
1.7.9.2.384.g4a92a
next prev parent reply other threads:[~2012-05-07 13:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 13:56 [Qemu-devel] [PATCH v3 0/4]: runstate: introduce 'suspended' state Luiz Capitulino
2012-05-07 13:56 ` [Qemu-devel] [PATCH 1/4] wakeup on migration Luiz Capitulino
2012-05-07 13:56 ` [Qemu-devel] [PATCH 2/4] qapi-schema.json: fix RunState enums alphabetical order Luiz Capitulino
2012-05-07 13:56 ` [Qemu-devel] [PATCH 3/4] runstate: introduce suspended state Luiz Capitulino
2012-05-07 13:56 ` Luiz Capitulino [this message]
2012-05-07 14:45 ` [Qemu-devel] [PATCH v3 0/4]: runstate: introduce 'suspended' state Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336399015-11269-5-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=armbru@redhat.com \
--cc=kraxel@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).