migration: Fix postcopy bw for recovery
authorPeter Xu <peterx@redhat.com>
Fri, 6 Sep 2019 13:01:03 +0000 (21:01 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 12 Sep 2019 10:21:25 +0000 (11:21 +0100)
We've got max-postcopy-bandwidth parameter but it's not applied
correctly after a postcopy recovery so the recovered migration stream
will still eat the whole net bandwidth.  Fix that up.

Reported-by: Xiaohui Li <xiaohli@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20190906130103.20961-1-peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/migration.c

index 2391a8d41806592d301eba025658c1891d0ae5b7..e45270c23b7469d256065add7c9373e90e0181f8 100644 (file)
@@ -3336,7 +3336,8 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
 
     if (resume) {
         /* This is a resumed migration */
-        rate_limit = INT64_MAX;
+        rate_limit = s->parameters.max_postcopy_bandwidth /
+            XFER_LIMIT_RATIO;
     } else {
         /* This is a fresh new migration */
         rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO;