qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 28/51] ram: Remove ram_save_remaining


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH 28/51] ram: Remove ram_save_remaining
Date: Fri, 24 Mar 2017 15:34:42 +0000
User-agent: Mutt/1.8.0 (2017-02-23)

* Juan Quintela (address@hidden) wrote:
> Just unfold it.  Move ram_bytes_remaining() with the rest of exported
> functions.
> 
> Signed-off-by: Juan Quintela <address@hidden>

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

> ---
>  migration/ram.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 3ae00e2..dd5a453 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -243,16 +243,16 @@ uint64_t xbzrle_mig_pages_overflow(void)
>      return ram_state.xbzrle_overflows;
>  }
>  
> -static ram_addr_t ram_save_remaining(void)
> -{
> -    return ram_state.migration_dirty_pages;
> -}
> -
>  uint64_t ram_bytes_transferred(void)
>  {
>      return ram_state.bytes_transferred;
>  }
>  
> +uint64_t ram_bytes_remaining(void)
> +{
> +    return ram_state.migration_dirty_pages * TARGET_PAGE_SIZE;
> +}
> +
>  /* used by the search for pages to send */
>  struct PageSearchStatus {
>      /* Current block being searched */
> @@ -1438,11 +1438,6 @@ void acct_update_position(QEMUFile *f, size_t size, 
> bool zero)
>      }
>  }
>  
> -uint64_t ram_bytes_remaining(void)
> -{
> -    return ram_save_remaining() * TARGET_PAGE_SIZE;
> -}
> -
>  uint64_t ram_bytes_total(void)
>  {
>      RAMBlock *block;
> @@ -2210,7 +2205,7 @@ static void ram_save_pending(QEMUFile *f, void *opaque, 
> uint64_t max_size,
>      RAMState *rs = opaque;
>      uint64_t remaining_size;
>  
> -    remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE;
> +    remaining_size = rs->migration_dirty_pages * TARGET_PAGE_SIZE;
>  
>      if (!migration_in_postcopy(migrate_get_current()) &&
>          remaining_size < max_size) {
> @@ -2219,7 +2214,7 @@ static void ram_save_pending(QEMUFile *f, void *opaque, 
> uint64_t max_size,
>          migration_bitmap_sync(rs);
>          rcu_read_unlock();
>          qemu_mutex_unlock_iothread();
> -        remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE;
> +        remaining_size = rs->migration_dirty_pages * TARGET_PAGE_SIZE;
>      }
>  
>      /* We can do postcopy, and all the data is postcopiable */
> -- 
> 2.9.3
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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