diff options
author | Juan Quintela <quintela@redhat.com> | 2023-03-02 01:22:44 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-04-24 15:01:47 +0200 |
commit | 2a8ec38082f8098f2693bb3632175453c0c84a51 (patch) | |
tree | 9e2500c2a2fe67addf5c08d16b9b90534e7103d8 | |
parent | 2682c4eea72c621dfd0fb0151cbd758e81d1bdff (diff) | |
download | qemu-2a8ec38082f8098f2693bb3632175453c0c84a51.zip qemu-2a8ec38082f8098f2693bb3632175453c0c84a51.tar.gz qemu-2a8ec38082f8098f2693bb3632175453c0c84a51.tar.bz2 |
migration: Create migrate_cpu_throttle_initial() to option.c
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
-rw-r--r-- | migration/options.c | 9 | ||||
-rw-r--r-- | migration/options.h | 1 | ||||
-rw-r--r-- | migration/ram.c | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/migration/options.c b/migration/options.c index 418aafa..f7fb699 100644 --- a/migration/options.c +++ b/migration/options.c @@ -509,6 +509,15 @@ int migrate_compress_wait_thread(void) return s->parameters.compress_wait_thread; } +uint8_t migrate_cpu_throttle_initial(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->parameters.cpu_throttle_initial; +} + int migrate_decompress_threads(void) { MigrationState *s; diff --git a/migration/options.h b/migration/options.h index 72b1a32..fd8b91d 100644 --- a/migration/options.h +++ b/migration/options.h @@ -50,6 +50,7 @@ uint32_t migrate_checkpoint_delay(void); int migrate_compress_level(void); int migrate_compress_threads(void); int migrate_compress_wait_thread(void); +uint8_t migrate_cpu_throttle_initial(void); int migrate_decompress_threads(void); uint8_t migrate_max_cpu_throttle(void); int64_t migrate_max_postcopy_bandwidth(void); diff --git a/migration/ram.c b/migration/ram.c index 5c78651..5e855d5 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -712,7 +712,7 @@ static void mig_throttle_guest_down(uint64_t bytes_dirty_period, uint64_t bytes_dirty_threshold) { MigrationState *s = migrate_get_current(); - uint64_t pct_initial = s->parameters.cpu_throttle_initial; + uint64_t pct_initial = migrate_cpu_throttle_initial(); uint64_t pct_increment = s->parameters.cpu_throttle_increment; bool pct_tailslow = s->parameters.cpu_throttle_tailslow; int pct_max = migrate_max_cpu_throttle(); |