mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
migration: We set the rate_limit by a second
That the implementation does the check every 100 milliseconds is an implementation detail that shouldn't be seen on the interfaz. Notice that all callers of qemu_file_set_rate_limit() used the division or pass 0, so this change is a NOP. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20230508130909.65420-4-quintela@redhat.com>
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
#include "migration.h"
|
||||
#include "qemu-file.h"
|
||||
#include "trace.h"
|
||||
#include "options.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
#define IO_BUF_SIZE 32768
|
||||
@ -744,7 +745,10 @@ int64_t qemu_file_get_rate_limit(QEMUFile *f)
|
||||
|
||||
void qemu_file_set_rate_limit(QEMUFile *f, int64_t limit)
|
||||
{
|
||||
f->rate_limit_max = limit;
|
||||
/*
|
||||
* 'limit' is per second. But we check it each 100 miliseconds.
|
||||
*/
|
||||
f->rate_limit_max = limit / XFER_LIMIT_RATIO;
|
||||
}
|
||||
|
||||
void qemu_file_reset_rate_limit(QEMUFile *f)
|
||||
|
Reference in New Issue
Block a user