diff options
author | Juan Quintela <quintela@redhat.com> | 2023-03-02 12:00:43 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-04-27 16:37:28 +0200 |
commit | f5da8ba4777f3ab88bfee82bbf8261d6295a26a2 (patch) | |
tree | 59d3c08d2893189bb2150d5aebf572e8d55d2a04 /migration | |
parent | 8f9c532756c598c29282a1ec2f11fb615e2fd3c7 (diff) | |
download | qemu-f5da8ba4777f3ab88bfee82bbf8261d6295a26a2.zip qemu-f5da8ba4777f3ab88bfee82bbf8261d6295a26a2.tar.gz qemu-f5da8ba4777f3ab88bfee82bbf8261d6295a26a2.tar.bz2 |
migration: Create migrate_downtime_limit() function
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/migration.c | 4 | ||||
-rw-r--r-- | migration/options.c | 7 | ||||
-rw-r--r-- | migration/options.h | 1 |
3 files changed, 10 insertions, 2 deletions
diff --git a/migration/migration.c b/migration/migration.c index 45fc5be..ee8e941 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2737,7 +2737,7 @@ static void migration_update_counters(MigrationState *s, transferred = current_bytes - s->iteration_initial_bytes; time_spent = current_time - s->iteration_start_time; bandwidth = (double)transferred / time_spent; - s->threshold_size = bandwidth * s->parameters.downtime_limit; + s->threshold_size = bandwidth * migrate_downtime_limit(); s->mbps = (((double) transferred * 8.0) / ((double) time_spent / 1000.0)) / 1000.0 / 1000.0; @@ -3244,7 +3244,7 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) */ migrate_error_free(s); - s->expected_downtime = s->parameters.downtime_limit; + s->expected_downtime = migrate_downtime_limit(); if (resume) { assert(s->cleanup_bh); } else { diff --git a/migration/options.c b/migration/options.c index 0b1b56e..f4ffe99 100644 --- a/migration/options.c +++ b/migration/options.c @@ -518,6 +518,13 @@ int migrate_decompress_threads(void) return s->parameters.decompress_threads; } +uint64_t migrate_downtime_limit(void) +{ + MigrationState *s = migrate_get_current(); + + return s->parameters.downtime_limit; +} + uint8_t migrate_max_cpu_throttle(void) { MigrationState *s = migrate_get_current(); diff --git a/migration/options.h b/migration/options.h index 86bcbb7..e982103 100644 --- a/migration/options.h +++ b/migration/options.h @@ -71,6 +71,7 @@ uint8_t migrate_cpu_throttle_increment(void); uint8_t migrate_cpu_throttle_initial(void); bool migrate_cpu_throttle_tailslow(void); int migrate_decompress_threads(void); +uint64_t migrate_downtime_limit(void); uint8_t migrate_max_cpu_throttle(void); uint64_t migrate_max_bandwidth(void); int64_t migrate_max_postcopy_bandwidth(void); |