mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
migration: allow rate > 4g
I'd like to disable bandwidth limit or make it very high, Use int64_t all over to make values >= 4g work. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
b2e0a138e7
commit
3d002df33e
4 changed files with 16 additions and 11 deletions
|
@ -206,20 +206,23 @@ static int buffered_rate_limit(void *opaque)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static size_t buffered_set_rate_limit(void *opaque, size_t new_rate)
|
||||
static int64_t buffered_set_rate_limit(void *opaque, int64_t new_rate)
|
||||
{
|
||||
QEMUFileBuffered *s = opaque;
|
||||
|
||||
if (s->has_error)
|
||||
goto out;
|
||||
|
||||
if (new_rate > SIZE_MAX) {
|
||||
new_rate = SIZE_MAX;
|
||||
}
|
||||
|
||||
s->xfer_limit = new_rate / 10;
|
||||
|
||||
out:
|
||||
return s->xfer_limit;
|
||||
}
|
||||
|
||||
static size_t buffered_get_rate_limit(void *opaque)
|
||||
static int64_t buffered_get_rate_limit(void *opaque)
|
||||
{
|
||||
QEMUFileBuffered *s = opaque;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue