migration: Use migration_transferred_bytes() to calculate rate_limit
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20230515195709.63843-9-quintela@redhat.com>
This commit is contained in:
@@ -81,6 +81,10 @@ typedef struct {
|
||||
* Number of bytes sent during precopy stage.
|
||||
*/
|
||||
Stat64 precopy_bytes;
|
||||
/*
|
||||
* Amount of transferred data at the start of current cycle.
|
||||
*/
|
||||
Stat64 rate_limit_start;
|
||||
/*
|
||||
* Maximum amount of data we can send in a cycle.
|
||||
*/
|
||||
@@ -122,8 +126,10 @@ uint64_t migration_rate_get(void);
|
||||
* migration_rate_reset: Reset the rate limit counter.
|
||||
*
|
||||
* This is called when we know we start a new transfer cycle.
|
||||
*
|
||||
* @f: QEMUFile used for main migration channel
|
||||
*/
|
||||
void migration_rate_reset(void);
|
||||
void migration_rate_reset(QEMUFile *f);
|
||||
|
||||
/**
|
||||
* migration_rate_set: Set the maximum amount that can be transferred.
|
||||
|
||||
Reference in New Issue
Block a user