* Peter Xu (pet...@redhat.com) wrote:
> Helper to init PSS structures.
> 
> Signed-off-by: Peter Xu <pet...@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com>

> ---
>  migration/ram.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 40ff5dc49f..b4b36ca59e 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -535,6 +535,14 @@ static bool do_compress_ram_page(QEMUFile *f, z_stream 
> *stream, RAMBlock *block,
>  static void postcopy_preempt_restore(RAMState *rs, PageSearchStatus *pss,
>                                       bool postcopy_requested);
>  
> +/* NOTE: page is the PFN not real ram_addr_t. */
> +static void pss_init(PageSearchStatus *pss, RAMBlock *rb, ram_addr_t page)
> +{
> +    pss->block = rb;
> +    pss->page = page;
> +    pss->complete_round = false;
> +}
> +
>  static void *do_data_compress(void *opaque)
>  {
>      CompressParam *param = opaque;
> @@ -2640,9 +2648,7 @@ static int ram_find_and_save_block(RAMState *rs)
>          rs->last_page = 0;
>      }
>  
> -    pss.block = rs->last_seen_block;
> -    pss.page = rs->last_page;
> -    pss.complete_round = false;
> +    pss_init(&pss, rs->last_seen_block, rs->last_page);
>  
>      do {
>          again = true;
> -- 
> 2.32.0
> 
-- 
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK


Reply via email to