qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH V1 15/32] vl: QEMU_START_FREEZE env var


From: Dr. David Alan Gilbert
Subject: Re: [PATCH V1 15/32] vl: QEMU_START_FREEZE env var
Date: Fri, 11 Sep 2020 19:49:27 +0100
User-agent: Mutt/1.14.6 (2020-07-11)

* Steve Sistare (steven.sistare@oracle.com) wrote:
> For qemu upgrade and restart, we will re-exec() qemu with the same argv.
> However, qemu must start in a paused state and wait for the cprload command,
> and the original argv might not contain the -S option.  To avoid modifying
> argv, provide the QEMU_START_FREEZE environment variable.  If
> QEMU_START_FREEZE is set, then set autostart=0, like the -S option.
> 
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>

What's wrong with modifying the argv?

Note, also the trick -incoming defer uses;  the whole point here is that
we start qemu with   -incoming defer     and then we can issue commands
to modify the QEMU configuration before we actually reload state.

Note, even without CPR there might be reasons that you need to modify
the argv; for example, imagine that since it was originally booted
someone had hotplug added an extra CPU or RAM or a disk; the new QEMU
must be started in a state that reflects the state in which the VM was
at the point when it was saved, not the point at which it was started
long ago.

Dave

> ---
>  softmmu/vl.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 951994f..7016e39 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -4501,6 +4501,11 @@ void qemu_init(int argc, char **argv, char **envp)
>          exit(0);
>      }
>  
> +    if (getenv("QEMU_START_FREEZE")) {
> +        unsetenv("QEMU_START_FREEZE");
> +        autostart = 0;
> +    }
> +
>      if (incoming) {
>          Error *local_err = NULL;
>          qemu_start_incoming_migration(incoming, &local_err);
> -- 
> 1.8.3.1
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK




reply via email to

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