summary refs log tree commit diff stats
path: root/migration/migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-05-08 15:08:51 +0200
committerJuan Quintela <quintela@redhat.com>2023-05-15 13:44:07 +0200
commit9d3ebbe21749937f9c9270d0841016e57de3fb92 (patch)
tree13f586512eeadae46c8723ad8184701ae3ea26e2 /migration/migration.c
parent52d01d4a5d6963e24ff59af0c39b47fd5d229fb7 (diff)
downloadfocaccia-qemu-9d3ebbe21749937f9c9270d0841016e57de3fb92.tar.gz
focaccia-qemu-9d3ebbe21749937f9c9270d0841016e57de3fb92.zip
migration: We set the rate_limit by a second
That the implementation does the check every 100 milliseconds is an
implementation detail that shouldn't be seen on the interfaz.
Notice that all callers of qemu_file_set_rate_limit() used the
division or pass 0, so this change is a NOP.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20230508130909.65420-4-quintela@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 5636119e8e..73ac63746b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2140,7 +2140,7 @@ static int postcopy_start(MigrationState *ms)
      * will notice we're in POSTCOPY_ACTIVE and not actually
      * wrap their state up here
      */
-    qemu_file_set_rate_limit(ms->to_dst_file, bandwidth / XFER_LIMIT_RATIO);
+    qemu_file_set_rate_limit(ms->to_dst_file, bandwidth);
     if (migrate_postcopy_ram()) {
         /* Ping just for debugging, helps line traces up */
         qemu_savevm_send_ping(ms->to_dst_file, 2);
@@ -3231,11 +3231,10 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
 
     if (resume) {
         /* This is a resumed migration */
-        rate_limit = migrate_max_postcopy_bandwidth() /
-            XFER_LIMIT_RATIO;
+        rate_limit = migrate_max_postcopy_bandwidth();
     } else {
         /* This is a fresh new migration */
-        rate_limit = migrate_max_bandwidth() / XFER_LIMIT_RATIO;
+        rate_limit = migrate_max_bandwidth();
 
         /* Notify before starting migration thread */
         notifier_list_notify(&migration_state_notifiers, s);