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:
Michael S. Tsirkin 2010-11-23 19:05:54 +02:00
parent b2e0a138e7
commit 3d002df33e
4 changed files with 16 additions and 11 deletions

View file

@ -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;