ram: Remove dirty_bytes_rate
It can be recalculated from dirty_pages_rate. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> -- Dave was the one that reviewed it O:-)
This commit is contained in:
		
							parent
							
								
									42d219d3b0
								
							
						
					
					
						commit
						abbf1d7f9b
					
				@ -155,7 +155,6 @@ struct MigrationState
 | 
				
			|||||||
    int64_t downtime;
 | 
					    int64_t downtime;
 | 
				
			||||||
    int64_t expected_downtime;
 | 
					    int64_t expected_downtime;
 | 
				
			||||||
    int64_t dirty_pages_rate;
 | 
					    int64_t dirty_pages_rate;
 | 
				
			||||||
    int64_t dirty_bytes_rate;
 | 
					 | 
				
			||||||
    bool enabled_capabilities[MIGRATION_CAPABILITY__MAX];
 | 
					    bool enabled_capabilities[MIGRATION_CAPABILITY__MAX];
 | 
				
			||||||
    int64_t xbzrle_cache_size;
 | 
					    int64_t xbzrle_cache_size;
 | 
				
			||||||
    int64_t setup_time;
 | 
					    int64_t setup_time;
 | 
				
			||||||
 | 
				
			|||||||
@ -1118,7 +1118,6 @@ MigrationState *migrate_init(const MigrationParams *params)
 | 
				
			|||||||
    s->downtime = 0;
 | 
					    s->downtime = 0;
 | 
				
			||||||
    s->expected_downtime = 0;
 | 
					    s->expected_downtime = 0;
 | 
				
			||||||
    s->dirty_pages_rate = 0;
 | 
					    s->dirty_pages_rate = 0;
 | 
				
			||||||
    s->dirty_bytes_rate = 0;
 | 
					 | 
				
			||||||
    s->setup_time = 0;
 | 
					    s->setup_time = 0;
 | 
				
			||||||
    s->start_postcopy = false;
 | 
					    s->start_postcopy = false;
 | 
				
			||||||
    s->postcopy_after_devices = false;
 | 
					    s->postcopy_after_devices = false;
 | 
				
			||||||
@ -2008,8 +2007,9 @@ static void *migration_thread(void *opaque)
 | 
				
			|||||||
                                      bandwidth, max_size);
 | 
					                                      bandwidth, max_size);
 | 
				
			||||||
            /* if we haven't sent anything, we don't want to recalculate
 | 
					            /* if we haven't sent anything, we don't want to recalculate
 | 
				
			||||||
               10000 is a small enough number for our purposes */
 | 
					               10000 is a small enough number for our purposes */
 | 
				
			||||||
            if (s->dirty_bytes_rate && transferred_bytes > 10000) {
 | 
					            if (s->dirty_pages_rate && transferred_bytes > 10000) {
 | 
				
			||||||
                s->expected_downtime = s->dirty_bytes_rate / bandwidth;
 | 
					                s->expected_downtime = s->dirty_pages_rate *
 | 
				
			||||||
 | 
					                    (1ul << qemu_target_page_bits()) / bandwidth;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            qemu_file_reset_rate_limit(s->to_dst_file);
 | 
					            qemu_file_reset_rate_limit(s->to_dst_file);
 | 
				
			||||||
 | 
				
			|||||||
@ -728,7 +728,6 @@ static void migration_bitmap_sync(RAMState *rs)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        s->dirty_pages_rate = rs->num_dirty_pages_period * 1000
 | 
					        s->dirty_pages_rate = rs->num_dirty_pages_period * 1000
 | 
				
			||||||
            / (end_time - rs->time_last_bitmap_sync);
 | 
					            / (end_time - rs->time_last_bitmap_sync);
 | 
				
			||||||
        s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
 | 
					 | 
				
			||||||
        rs->time_last_bitmap_sync = end_time;
 | 
					        rs->time_last_bitmap_sync = end_time;
 | 
				
			||||||
        rs->num_dirty_pages_period = 0;
 | 
					        rs->num_dirty_pages_period = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user