aboutsummaryrefslogtreecommitdiff
path: root/migration/migration-stats.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-05-15 21:57:01 +0200
committerJuan Quintela <quintela@redhat.com>2023-05-18 18:40:51 +0200
commit813cd61669e45ee6d5db09a83d03df8f0c6eb5d2 (patch)
tree7a9dc33647ab2952477c3f3ede345ad7b7759551 /migration/migration-stats.h
parent3db9c05a9006550da3a73600cec89bb995420325 (diff)
downloadqemu-813cd61669e45ee6d5db09a83d03df8f0c6eb5d2.zip
qemu-813cd61669e45ee6d5db09a83d03df8f0c6eb5d2.tar.gz
qemu-813cd61669e45ee6d5db09a83d03df8f0c6eb5d2.tar.bz2
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>
Diffstat (limited to 'migration/migration-stats.h')
-rw-r--r--migration/migration-stats.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/migration/migration-stats.h b/migration/migration-stats.h
index 827ea80..4c4daa2 100644
--- a/migration/migration-stats.h
+++ b/migration/migration-stats.h
@@ -82,6 +82,10 @@ typedef struct {
*/
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.
*/
Stat64 rate_limit_max;
@@ -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.