On Tue, 13 Jun 2023 16:57:46 +0200
Juan Quintela wrote:
> Signed-off-by: Juan Quintela
>
> fix ram_compress
>
> Signed-off-by: Juan Quintela
Commit message is off. Other than that:
Reviewed-by: Lukas Straub
> ---
> migration/ram-compress.h | 1 +
> migration/ram-compress.c | 6 ++
> migration/ram.c | 2 +-
> 3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/migration/ram-compress.h b/migration/ram-compress.h
> index 43ff44c0ba..77465dad4b 100644
> --- a/migration/ram-compress.h
> +++ b/migration/ram-compress.h
> @@ -69,5 +69,6 @@ int compress_threads_load_setup(QEMUFile *f);
> void decompress_data_with_multi_threads(QEMUFile *f, void *host, int len);
>
> void populate_compress(MigrationInfo *info);
> +uint64_t ram_compressed_pages(void);
>
> #endif
> diff --git a/migration/ram-compress.c b/migration/ram-compress.c
> index a91c32588e..c48d5c53f6 100644
> --- a/migration/ram-compress.c
> +++ b/migration/ram-compress.c
> @@ -502,3 +502,9 @@ void populate_compress(MigrationInfo *info)
> compression_counters.compression_rate;
> }
> }
> +
> +uint64_t ram_compressed_pages(void)
> +{
> +return compression_counters.pages;
> +}
> +
> diff --git a/migration/ram.c b/migration/ram.c
> index d4943b982f..13c518f81a 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -927,7 +927,7 @@ uint64_t ram_get_total_transferred_pages(void)
> {
> return stat64_get(_stats.normal_pages) +
> stat64_get(_stats.zero_pages) +
> -compression_counters.pages + xbzrle_counters.pages;
> +ram_compressed_pages() + xbzrle_counters.pages;
> }
>
> static void migration_update_rates(RAMState *rs, int64_t end_time)
pgpuSYaow68dz.pgp
Description: OpenPGP digital signature