qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Joelle van Dyne <j@getutm.app>
To: qemu-devel@nongnu.org
Cc: Joelle van Dyne <j@getutm.app>, Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 2/3] vl: on -loadvm set run state to "restore-vm"
Date: Fri, 12 Aug 2022 18:10:30 -0700	[thread overview]
Message-ID: <20220813011031.3744-3-j@getutm.app> (raw)
In-Reply-To: <20220813011031.3744-1-j@getutm.app>

This allows us to differentiate between a fresh boot and a restore boot.

Signed-off-by: Joelle van Dyne <j@getutm.app>
---
 softmmu/runstate.c | 1 +
 softmmu/vl.c       | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 1e68680b9d..fa3dd3a4ab 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -76,6 +76,7 @@ typedef struct {
 
 static const RunStateTransition runstate_transitions_def[] = {
     { RUN_STATE_PRELAUNCH, RUN_STATE_INMIGRATE },
+    { RUN_STATE_PRELAUNCH, RUN_STATE_RESTORE_VM },
 
     { RUN_STATE_DEBUG, RUN_STATE_RUNNING },
     { RUN_STATE_DEBUG, RUN_STATE_FINISH_MIGRATE },
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 706bd7cff7..29586d94ff 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3131,6 +3131,9 @@ void qemu_init(int argc, char **argv, char **envp)
                 add_device_config(DEV_DEBUGCON, optarg);
                 break;
             case QEMU_OPTION_loadvm:
+                if (!loadvm) {
+                    runstate_set(RUN_STATE_RESTORE_VM);
+                }
                 loadvm = optarg;
                 break;
             case QEMU_OPTION_full_screen:
-- 
2.28.0



  parent reply	other threads:[~2022-08-13  1:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13  1:10 [PATCH 0/3] Set runstate to RUN_STATE_RESTORE_VM when started with "-loadvm" Joelle van Dyne
2022-08-13  1:10 ` [PATCH 1/3] Revert "usbredir: avoid queuing hello packet on snapshot restore" Joelle van Dyne
2022-11-21 12:26   ` Ján Tomko
2022-08-13  1:10 ` Joelle van Dyne [this message]
2022-08-22 10:11   ` [PATCH 2/3] vl: on -loadvm set run state to "restore-vm" Daniel P. Berrangé
2022-10-29 23:35     ` Joelle van Dyne
2022-08-13  1:10 ` [PATCH 3/3] usbredir: avoid queuing hello packet on snapshot restore Joelle van Dyne
2022-08-13  5:30   ` Victor Toso
2022-08-13  5:33     ` Joelle van Dyne
2022-08-13  5:50       ` Victor Toso
2022-08-13  5:57         ` Joelle van Dyne
2022-08-13  7:12           ` Victor Toso

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=20220813011031.3744-3-j@getutm.app \
    --to=j@getutm.app \
    --cc=pbonzini@redhat.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).