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>
This commit is contained in:
1 parent
de37f8b9c2
commit
e1fde0e038
16 files changed
+124
-90
No files matched your search
+1
-1
@@ -1338,7 +1338,7 @@ int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy)
|
||||
!(se->ops->has_postcopy && se->ops->has_postcopy(se->opaque))) {
|
||||
continue;
|
||||
}
|
||||
if (qemu_file_rate_limit(f)) {
|
||||
if (migration_rate_exceeded(f)) {
|
||||
return 0;
|
||||
}
|
||||
trace_savevm_section_start(se->idstr, se->section_id);
|
||||
|
||||
Reference in new issue
Block a user