qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] migration: We also want to store the global sta


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH] migration: We also want to store the global state for savevm
Date: Wed, 15 Jul 2015 09:18:16 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

* Juan Quintela (address@hidden) wrote:
> Previous commit only stored a valid state for migration.  It stored the
> empty string for savevm.  Now, we are also storing the current state for
> savevm.
> 
> Signed-off-by: Juan Quintela <address@hidden>

Reviewed-by: Dr. David Alan Gilbert <address@hidden>

Looks OK to me; Christian - does it fix it for you?

Dave

> ---
>  include/migration/migration.h | 1 +
>  migration/migration.c         | 2 +-
>  migration/savevm.c            | 6 ++++++
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/include/migration/migration.h b/include/migration/migration.h
> index b2711ef..a2f8ed0 100644
> --- a/include/migration/migration.h
> +++ b/include/migration/migration.h
> @@ -202,4 +202,5 @@ void savevm_skip_section_footers(void);
>  void register_global_state(void);
>  void global_state_set_optional(void);
>  void savevm_skip_configuration(void);
> +int global_state_store(void);
>  #endif
> diff --git a/migration/migration.c b/migration/migration.c
> index ba82ff6..86ca099 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -110,7 +110,7 @@ typedef struct {
> 
>  static GlobalState global_state;
> 
> -static int global_state_store(void)
> +int global_state_store(void)
>  {
>      if (!runstate_store((char *)global_state.runstate,
>                          sizeof(global_state.runstate))) {
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 86735fc..81dbe58 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1315,6 +1315,12 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
>      }
> 
>      saved_vm_running = runstate_is_running();
> +
> +    ret = global_state_store();
> +    if (ret) {
> +        monitor_printf(mon, "Error saving global state\n");
> +        return;
> +    }
>      vm_stop(RUN_STATE_SAVE_VM);
> 
>      memset(sn, 0, sizeof(*sn));
> -- 
> 2.4.3
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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