diff options
author | Juan Quintela <quintela@redhat.com> | 2017-03-13 20:57:27 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2017-04-21 12:25:36 +0200 |
commit | 07ed50a2bb66a4d5ab2d7e54a5dfc4b618cccacc (patch) | |
tree | 23be920447d452d9472cc4336da72654ef0f1d75 /migration | |
parent | 23b28c3c62fc95a9652a76d2257cce21b9b0b391 (diff) |
ram: Move xbzrle_bytes into RAMState
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/ram.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/migration/ram.c b/migration/ram.c index 3e500ae417..4dc786921e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -172,6 +172,8 @@ struct RAMState { uint64_t norm_pages; /* Iterations since start */ uint64_t iterations; + /* xbzrle transmitted bytes */ + uint64_t xbzrle_bytes; }; typedef struct RAMState RAMState; @@ -179,7 +181,6 @@ static RAMState ram_state; /* accounting for migration statistics */ typedef struct AccountingInfo { - uint64_t xbzrle_bytes; uint64_t xbzrle_pages; uint64_t xbzrle_cache_miss; double xbzrle_cache_miss_rate; @@ -205,7 +206,7 @@ uint64_t norm_mig_pages_transferred(void) uint64_t xbzrle_mig_bytes_transferred(void) { - return acct_info.xbzrle_bytes; + return ram_state.xbzrle_bytes; } uint64_t xbzrle_mig_pages_transferred(void) @@ -544,7 +545,7 @@ static int save_xbzrle_page(RAMState *rs, QEMUFile *f, uint8_t **current_data, qemu_put_buffer(f, XBZRLE.encoded_buf, encoded_len); bytes_xbzrle += encoded_len + 1 + 2; acct_info.xbzrle_pages++; - acct_info.xbzrle_bytes += bytes_xbzrle; + rs->xbzrle_bytes += bytes_xbzrle; *bytes_transferred += bytes_xbzrle; return 1; @@ -1996,6 +1997,7 @@ static int ram_save_init_globals(RAMState *rs) rs->zero_pages = 0; rs->norm_pages = 0; rs->iterations = 0; + rs->xbzrle_bytes = 0; migration_bitmap_sync_init(rs); qemu_mutex_init(&migration_bitmap_mutex); |