qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] vl: on -loadvm set run state to "restore-vm"


From: Daniel P . Berrangé
Subject: Re: [PATCH 2/3] vl: on -loadvm set run state to "restore-vm"
Date: Mon, 22 Aug 2022 11:11:08 +0100
User-agent: Mutt/2.2.6 (2022-06-05)

On Fri, Aug 12, 2022 at 06:10:30PM -0700, Joelle van Dyne wrote:
> 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(+)

What happens if the user launches QEMU with -S and NOT  -loadvm, and
then uses the 'loadvm' monitor command to restore the VM state ?


> 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
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]