* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela <quint...@redhat.com> > --- > migration/ram.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 721fd66..b4e647a 100644 > --- a/migration/ram.c > +++ b/migration/ram.c > @@ -174,6 +174,8 @@ struct RAMState { > uint64_t iterations; > /* xbzrle transmitted bytes */ > uint64_t xbzrle_bytes; > + /* xbzrle transmmited pages */ > + uint64_t xbzrle_pages;
Yes, it might be useful to comment that the bytes are compressed bytes while the pages are raw so it's not just a ratio. Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > }; > typedef struct RAMState RAMState; > > @@ -181,7 +183,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 +212,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 +545,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; > > @@ -1997,6 +1998,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); > > -- > 2.9.3 > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK