params->has_cpr_exec_command = true;
}
+static void migrate_post_update_params(MigrationParameters *new, Error **errp)
+{
+ MigrationState *s = migrate_get_current();
+
+ if (new->has_max_bandwidth) {
+ if (s->to_dst_file && !migration_in_postcopy()) {
+ migration_rate_set(new->max_bandwidth);
+ }
+ }
+
+ if (new->has_x_checkpoint_delay) {
+ colo_checkpoint_delay_set();
+ }
+
+ if (new->has_xbzrle_cache_size) {
+ xbzrle_cache_resize(new->xbzrle_cache_size, errp);
+ }
+
+ if (new->has_max_postcopy_bandwidth) {
+ if (s->to_dst_file && migration_in_postcopy()) {
+ migration_rate_set(new->max_postcopy_bandwidth);
+ }
+ }
+}
+
/*
* Check whether the parameters are valid. Error will be put into errp
* (if provided). Return true if valid, otherwise false.
}
}
-static void migrate_params_apply(MigrationParameters *params, Error **errp)
+static void migrate_params_apply(MigrationParameters *params)
{
MigrationState *s = migrate_get_current();
if (params->has_max_bandwidth) {
s->parameters.max_bandwidth = params->max_bandwidth;
- if (s->to_dst_file && !migration_in_postcopy()) {
- migration_rate_set(s->parameters.max_bandwidth);
- }
}
if (params->has_avail_switchover_bandwidth) {
if (params->has_x_checkpoint_delay) {
s->parameters.x_checkpoint_delay = params->x_checkpoint_delay;
- colo_checkpoint_delay_set();
}
if (params->has_multifd_channels) {
}
if (params->has_xbzrle_cache_size) {
s->parameters.xbzrle_cache_size = params->xbzrle_cache_size;
- xbzrle_cache_resize(params->xbzrle_cache_size, errp);
}
if (params->has_max_postcopy_bandwidth) {
s->parameters.max_postcopy_bandwidth = params->max_postcopy_bandwidth;
- if (s->to_dst_file && migration_in_postcopy()) {
- migration_rate_set(s->parameters.max_postcopy_bandwidth);
- }
}
if (params->has_max_cpu_throttle) {
s->parameters.max_cpu_throttle = params->max_cpu_throttle;
migrate_params_test_apply(params, &tmp);
if (migrate_params_check(&tmp, errp)) {
- migrate_params_apply(params, errp);
+ migrate_params_apply(params);
+ migrate_post_update_params(params, errp);
}
migrate_tls_opts_free(&tmp);