* zhanghailiang ([email protected]) wrote:
> If VM is in COLO FT state, we should do some extra work before normal shutdown
> process. SVM will ignore the shutdown command if this command is issued
> directly
> to it, PVM will send the shutdown command to SVM if it gets this command.
>
> Cc: Paolo Bonzini <[email protected]>
> Signed-off-by: zhanghailiang <[email protected]>
> Signed-off-by: Li Zhijian <[email protected]>
> ---
> v13:
> - Move COLO shutdown related codes to colo.c file (Dave's suggestion)
> diff --git a/migration/colo.c b/migration/colo.c
> index de01ade..2bea519 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -248,6 +248,7 @@ static uint64_t colo_get_cmd_value(QEMUFile *f, uint32_t
> expect_cmd,
> static int colo_do_checkpoint_transaction(MigrationState *s,
> QEMUSizedBuffer *buffer)
> {
> + int colo_shutdown;
> QEMUFile *trans = NULL;
> size_t size;
> Error *local_err = NULL;
> @@ -277,6 +278,7 @@ static int colo_do_checkpoint_transaction(MigrationState
> *s,
> qemu_mutex_unlock_iothread();
> goto out;
> }
> + colo_shutdown = colo_shutdown_requested;
> vm_stop_force_state(RUN_STATE_COLO);
> qemu_mutex_unlock_iothread();
> trace_colo_vm_state_change("run", "stop");
> @@ -330,6 +332,18 @@ static int colo_do_checkpoint_transaction(MigrationState
> *s,
> goto out;
> }
>
> + if (colo_shutdown) {
Why do you take a copy of colo_shutdown_requested rather than just use
it directly?
Dave
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK