diff options
author | Juan Quintela <quintela@redhat.com> | 2023-06-13 16:57:46 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-10-17 22:14:51 +0200 |
commit | f504789de509cded05562bb3bb9abfa222446222 (patch) | |
tree | 5dadf7e52ecb09e94fbbd4e02e2b2c273c5e9bd9 /migration | |
parent | 6f609005730d51e085d7404fcfc72576add237e1 (diff) | |
download | qemu-f504789de509cded05562bb3bb9abfa222446222.zip qemu-f504789de509cded05562bb3bb9abfa222446222.tar.gz qemu-f504789de509cded05562bb3bb9abfa222446222.tar.bz2 |
migration: Create ram_compressed_pages()
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Message-ID: <20230613145757.10131-8-quintela@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/ram-compress.c | 6 | ||||
-rw-r--r-- | migration/ram-compress.h | 1 | ||||
-rw-r--r-- | migration/ram.c | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/migration/ram-compress.c b/migration/ram-compress.c index bbf78a0..d54345d 100644 --- a/migration/ram-compress.c +++ b/migration/ram-compress.c @@ -501,3 +501,9 @@ void populate_compress(MigrationInfo *info) info->compression->compressed_size = compression_counters.compressed_size; info->compression->compression_rate = compression_counters.compression_rate; } + +uint64_t ram_compressed_pages(void) +{ + return compression_counters.pages; +} + diff --git a/migration/ram-compress.h b/migration/ram-compress.h index 43ff44c..77465da 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.c b/migration/ram.c index c844151..2a9c899 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -939,7 +939,7 @@ uint64_t ram_get_total_transferred_pages(void) { return stat64_get(&mig_stats.normal_pages) + stat64_get(&mig_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) |