ram: Move xbzrle_bytes into RAMState
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
23b28c3c62
commit
07ed50a2bb
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue