[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 35/43] migration: Create migrate_downtime_limit() function
From: |
Juan Quintela |
Subject: |
[PATCH 35/43] migration: Create migrate_downtime_limit() function |
Date: |
Thu, 2 Mar 2023 17:34:02 +0100 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/options.h | 1 +
migration/migration.c | 4 ++--
migration/options.c | 7 +++++++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/migration/options.h b/migration/options.h
index c7c9a4002b..10a59b1172 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -73,6 +73,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);
diff --git a/migration/migration.c b/migration/migration.c
index 62a6f29647..9db8e09462 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2733,7 +2733,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;
@@ -3240,7 +3240,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 350cd24e28..6034443cee 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -519,6 +519,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();
--
2.39.2
- [PATCH 15/43] migration: Move qmp_query_migrate_capabilities() to options.c, (continued)
- [PATCH 15/43] migration: Move qmp_query_migrate_capabilities() to options.c, Juan Quintela, 2023/03/02
- [PATCH 14/43] migration: Move migrate_caps_check() to options.c, Juan Quintela, 2023/03/02
- [PATCH 16/43] migration: Move qmp_migrate_set_capabilities() to options.c, Juan Quintela, 2023/03/02
- [PATCH 17/43] migration: Move migrate_cap_set() to options.c, Juan Quintela, 2023/03/02
- [PATCH 18/43] migration: Move parameters functions to option.c, Juan Quintela, 2023/03/02
- [PATCH 19/43] migration: Use migrate_max_postcopy_bandwidth(), Juan Quintela, 2023/03/02
- [PATCH 20/43] migration: Move migrate_use_block_incremental() to option.c, Juan Quintela, 2023/03/02
- [PATCH 21/43] migration: Create migrate_throttle_trigger_threshold(), Juan Quintela, 2023/03/02
- [PATCH 22/43] migration: Create migrate_checkpoint_delay(), Juan Quintela, 2023/03/02
- [PATCH 27/43] migration: Create migrate_cpu_throttle_tailslow() function, Juan Quintela, 2023/03/02
- [PATCH 35/43] migration: Create migrate_downtime_limit() function,
Juan Quintela <=
- [PATCH 29/43] migration: Move migrate_postcopy() to options.c, Juan Quintela, 2023/03/02
- [PATCH 26/43] migration: Create migrate_cpu_throttle_increment() function, Juan Quintela, 2023/03/02
- [PATCH 28/43] migration: Move migrate_use_tls() to options.c, Juan Quintela, 2023/03/02
- [PATCH 24/43] migration: Move migrate_announce_params() to option.c, Juan Quintela, 2023/03/02
- [PATCH 33/43] migration: Create migrate_params_init() function, Juan Quintela, 2023/03/02
- [PATCH 25/43] migration: Create migrate_cpu_throttle_initial() to option.c, Juan Quintela, 2023/03/02
- [PATCH 30/43] migration: Create migrate_max_bandwidth() function, Juan Quintela, 2023/03/02
- [PATCH 32/43] migration: Move qmp_migrate_set_parameters() to options.c, Juan Quintela, 2023/03/02
- [PATCH 34/43] migration: Make all functions check have the same format, Juan Quintela, 2023/03/02
- [PATCH 23/43] migration: Create migrate_max_cpu_throttle(), Juan Quintela, 2023/03/02