summaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2019-03-08 10:12:10 +0000
committerJuan Quintela <quintela@redhat.com>2019-03-25 18:46:03 +0100
commitc38c1c142e64901b09f5ac000695071ed8c0e3a5 (patch)
tree77a705aed44fdeaf7cdf339e6fa4b4b45d00117d /migration/migration.c
parent5ed0deca41b201a66d858d7296fe6b780d757404 (diff)
downloadqemu-c38c1c142e64901b09f5ac000695071ed8c0e3a5.zip
migration/postcopy: Update the bandwidth during postcopy
The recently added max-postcopy-bandwidth parameter is only read at the transition from precopy->postcopy where as the older max-bandwidth parameter updates the migration bandwidth when changed even if the migration is already running. Fix this discrepency so that: a) You can change the bandwidth during postcopy by setting max-postcopy-bandwidth b) Changing max-bandwidth during postcopy has no effect (it currently changes the postcopy bandwidth which isn't expected). Fixes: 7e555c6c bz: https://bugzilla.redhat.com/show_bug.cgi?id=1686321 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/migration/migration.c b/migration/migration.c
index d5c218a22b..69f75124c9 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1341,7 +1341,7 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
if (params->has_max_bandwidth) {
s->parameters.max_bandwidth = params->max_bandwidth;
- if (s->to_dst_file) {
+ if (s->to_dst_file && !migration_in_postcopy()) {
qemu_file_set_rate_limit(s->to_dst_file,
s->parameters.max_bandwidth / XFER_LIMIT_RATIO);
}
@@ -1370,6 +1370,10 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
}
if (params->has_max_postcopy_bandwidth) {
s->parameters.max_postcopy_bandwidth = params->max_postcopy_bandwidth;
+ if (s->to_dst_file && migration_in_postcopy()) {
+ qemu_file_set_rate_limit(s->to_dst_file,
+ s->parameters.max_postcopy_bandwidth / XFER_LIMIT_RATIO);
+ }
}
if (params->has_max_cpu_throttle) {
s->parameters.max_cpu_throttle = params->max_cpu_throttle;