diff options
| author | Juan Quintela <quintela@redhat.com> | 2023-05-15 21:56:58 +0200 |
|---|---|---|
| committer | Juan Quintela <quintela@redhat.com> | 2023-05-18 18:40:51 +0200 |
| commit | e1fde0e038bafd0bd05db7d43305b9b2f03c0683 (patch) | |
| tree | 14c6f72e2e86867957e62c01ac2ec2363dcbcc58 /migration/options.c | |
| parent | de37f8b9c21e1c6ef98eebb0b05bd83e5867bc6f (diff) | |
| download | focaccia-qemu-e1fde0e038bafd0bd05db7d43305b9b2f03c0683.tar.gz focaccia-qemu-e1fde0e038bafd0bd05db7d43305b9b2f03c0683.zip | |
migration: Move rate_limit_max and rate_limit_used to migration_stats
These way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Functions got renamed, they are not qemu_file anymore. qemu_file_rate_limit -> migration_rate_exceeded qemu_file_set_rate_limit -> migration_rate_set qemu_file_get_rate_limit -> migration_rate_get qemu_file_reset_rate_limit -> migration_rate_reset qemu_file_acct_rate_limit -> migration_rate_account. Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20230515195709.63843-6-quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/options.c')
| -rw-r--r-- | migration/options.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/migration/options.c b/migration/options.c index c2a278ee2d..b62ab30cd5 100644 --- a/migration/options.c +++ b/migration/options.c @@ -23,6 +23,7 @@ #include "migration/colo.h" #include "migration/misc.h" #include "migration.h" +#include "migration-stats.h" #include "qemu-file.h" #include "ram.h" #include "options.h" @@ -1242,8 +1243,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 && !migration_in_postcopy()) { - qemu_file_set_rate_limit(s->to_dst_file, - s->parameters.max_bandwidth); + migration_rate_set(s->parameters.max_bandwidth); } } @@ -1272,8 +1272,7 @@ 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); + migration_rate_set(s->parameters.max_postcopy_bandwidth); } } if (params->has_max_cpu_throttle) { |