"Dr. David Alan Gilbert (git)" <[email protected]> wrote:
> From: "Dr. David Alan Gilbert" <[email protected]>
>
> Add qemu_savevm_state_complete_postcopy to complement
> qemu_savevm_state_complete_precopy together with a new
> save_live_complete_postcopy method on devices.
>
> The save_live_complete_precopy method is called on
> all devices during a precopy migration, and all non-postcopy
> devices during a postcopy migration at the transition.
>
> The save_live_complete_postcopy method is called at
> the end of postcopy for all postcopiable devices.
>
> Signed-off-by: Dr. David Alan Gilbert <[email protected]>

Reviewed-by: Juan Quintela <[email protected]>


> @@ -947,13 +987,15 @@ void qemu_savevm_state_complete_precopy(QEMUFile *f)
>      int vmdesc_len;
>      SaveStateEntry *se;
>      int ret;
> +    bool in_postcopy = migration_postcopy_phase(migrate_get_current());
>  
>      trace_savevm_state_complete_precopy();
>  
>      cpu_synchronize_all_states();
>  
>      QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
> -        if (!se->ops || !se->ops->save_live_complete_precopy) {
> +        if (!se->ops || !se->ops->save_live_complete_precopy ||
> +            (in_postcopy && se->ops->save_live_complete_postcopy)) {
>              continue;
>          }

I would change the formatting to something like:

       if (!se->ops ||
           (in_postcopy && se->ops->save_live_complete_postcopy)
           !se->ops->save_live_complete_precopy) {
              continue
           }

Just to make easier to see when we exit?

Later, Juan.

Reply via email to