qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steve Sistare <steven.sistare@oracle.com>
To: qemu-devel@nongnu.org
Cc: "Peter Xu" <peterx@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Leonardo Bras" <leobras@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Anthony PERARD" <anthony.perard@citrix.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Paul Durrant" <paul@xen.org>, "Eric Blake" <eblake@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Steve Sistare" <steven.sistare@oracle.com>
Subject: [PATCH V9 04/12] cpus: vm_resume
Date: Wed,  3 Jan 2024 12:05:33 -0800	[thread overview]
Message-ID: <1704312341-66640-5-git-send-email-steven.sistare@oracle.com> (raw)
In-Reply-To: <1704312341-66640-1-git-send-email-steven.sistare@oracle.com>

Define the vm_resume helper, for use in subsequent patches.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---
 include/sysemu/runstate.h | 9 +++++++++
 system/cpus.c             | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h
index 618eb49..0117d24 100644
--- a/include/sysemu/runstate.h
+++ b/include/sysemu/runstate.h
@@ -57,6 +57,15 @@ void vm_start(void);
  * @step_pending: whether any of the CPUs is about to be single-stepped by gdb
  */
 int vm_prepare_start(bool step_pending);
+
+/**
+ * vm_resume: If @state is a live state, start the vm and set the state,
+ * else just set the state.
+ *
+ * @state: the state to restore
+ */
+void vm_resume(RunState state);
+
 int vm_stop(RunState state);
 int vm_stop_force_state(RunState state);
 int vm_shutdown(void);
diff --git a/system/cpus.c b/system/cpus.c
index f162435..7d2c28b 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -748,6 +748,15 @@ void vm_start(void)
     }
 }
 
+void vm_resume(RunState state)
+{
+    if (runstate_is_live(state)) {
+        vm_start();
+    } else {
+        runstate_set(state);
+    }
+}
+
 /* does a state transition even if the VM is already stopped,
    current state is forgotten forever */
 int vm_stop_force_state(RunState state)
-- 
1.8.3.1



  parent reply	other threads:[~2024-01-03 20:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 20:05 [PATCH V9 00/12] fix migration of suspended runstate Steve Sistare
2024-01-03 20:05 ` [PATCH V9 01/12] cpus: vm_was_suspended Steve Sistare
2024-01-03 20:05 ` [PATCH V9 02/12] cpus: stop vm in suspended runstate Steve Sistare
2024-01-03 20:05 ` [PATCH V9 03/12] cpus: check running not RUN_STATE_RUNNING Steve Sistare
2024-01-03 20:05 ` Steve Sistare [this message]
2024-01-03 20:05 ` [PATCH V9 05/12] migration: propagate suspended runstate Steve Sistare
2024-01-03 20:05 ` [PATCH V9 06/12] migration: preserve " Steve Sistare
2024-01-03 20:05 ` [PATCH V9 07/12] migration: preserve suspended for snapshot Steve Sistare
2024-01-03 20:05 ` [PATCH V9 08/12] migration: preserve suspended for bg_migration Steve Sistare
2024-01-03 20:05 ` [PATCH V9 09/12] tests/qtest: migration events Steve Sistare
2024-01-03 20:05 ` [PATCH V9 10/12] tests/qtest: option to suspend during migration Steve Sistare
2024-01-03 20:05 ` [PATCH V9 11/12] tests/qtest: precopy migration with suspend Steve Sistare
2024-01-03 20:05 ` [PATCH V9 12/12] tests/qtest: postcopy " Steve Sistare
2024-01-04  4:37 ` [PATCH V9 00/12] fix migration of suspended runstate Peter Xu
2024-01-08 12:47   ` Markus Armbruster

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=1704312341-66640-5-git-send-email-steven.sistare@oracle.com \
    --to=steven.sistare@oracle.com \
    --cc=anthony.perard@citrix.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=kraxel@redhat.com \
    --cc=leobras@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=thuth@redhat.com \
    /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).