aboutsummaryrefslogtreecommitdiff
path: root/migration/ram.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration/ram.c')
-rw-r--r--migration/ram.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/migration/ram.c b/migration/ram.c
index 4dc786921e..cf6681c467 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -172,8 +172,11 @@ struct RAMState {
uint64_t norm_pages;
/* Iterations since start */
uint64_t iterations;
- /* xbzrle transmitted bytes */
+ /* xbzrle transmitted bytes. Notice that this is with
+ * compression, they can't be calculated from the pages */
uint64_t xbzrle_bytes;
+ /* xbzrle transmmited pages */
+ uint64_t xbzrle_pages;
};
typedef struct RAMState RAMState;
@@ -181,7 +184,6 @@ static RAMState ram_state;
/* accounting for migration statistics */
typedef struct AccountingInfo {
- uint64_t xbzrle_pages;
uint64_t xbzrle_cache_miss;
double xbzrle_cache_miss_rate;
uint64_t xbzrle_overflows;
@@ -211,7 +213,7 @@ uint64_t xbzrle_mig_bytes_transferred(void)
uint64_t xbzrle_mig_pages_transferred(void)
{
- return acct_info.xbzrle_pages;
+ return ram_state.xbzrle_pages;
}
uint64_t xbzrle_mig_pages_cache_miss(void)
@@ -544,7 +546,7 @@ static int save_xbzrle_page(RAMState *rs, QEMUFile *f, uint8_t **current_data,
qemu_put_be16(f, encoded_len);
qemu_put_buffer(f, XBZRLE.encoded_buf, encoded_len);
bytes_xbzrle += encoded_len + 1 + 2;
- acct_info.xbzrle_pages++;
+ rs->xbzrle_pages++;
rs->xbzrle_bytes += bytes_xbzrle;
*bytes_transferred += bytes_xbzrle;
@@ -1998,6 +2000,7 @@ static int ram_save_init_globals(RAMState *rs)
rs->norm_pages = 0;
rs->iterations = 0;
rs->xbzrle_bytes = 0;
+ rs->xbzrle_pages = 0;
migration_bitmap_sync_init(rs);
qemu_mutex_init(&migration_bitmap_mutex);