migration: export vcpu_dirty_limit_period
Define and export vcpu_dirty_limit_period to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Link: https://lore.kernel.org/r/1710179338-294359-6-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
aeaafb1e59
commit
714f33123b
@ -20,5 +20,6 @@ bool migrate_switchover_ack(void);
|
||||
/* parameters */
|
||||
|
||||
MigMode migrate_mode(void);
|
||||
uint64_t migrate_vcpu_dirty_limit_period(void);
|
||||
|
||||
#endif
|
||||
|
@ -924,6 +924,13 @@ const char *migrate_tls_hostname(void)
|
||||
return s->parameters.tls_hostname;
|
||||
}
|
||||
|
||||
uint64_t migrate_vcpu_dirty_limit_period(void)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
|
||||
return s->parameters.x_vcpu_dirty_limit_period;
|
||||
}
|
||||
|
||||
uint64_t migrate_xbzrle_cache_size(void)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
|
@ -77,14 +77,13 @@ static bool dirtylimit_quit;
|
||||
|
||||
static void vcpu_dirty_rate_stat_collect(void)
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
VcpuStat stat;
|
||||
int i = 0;
|
||||
int64_t period = DIRTYLIMIT_CALC_TIME_MS;
|
||||
|
||||
if (migrate_dirty_limit() &&
|
||||
migration_is_active()) {
|
||||
period = s->parameters.x_vcpu_dirty_limit_period;
|
||||
period = migrate_vcpu_dirty_limit_period();
|
||||
}
|
||||
|
||||
/* calculate vcpu dirtyrate */
|
||||
|
Loading…
Reference in New Issue
Block a user