diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-11-23 19:05:54 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-12-02 21:13:39 +0200 |
commit | cebd32550908857e7f9129b02bb52d97e693afab (patch) | |
tree | 5c2a07b26b26f74b9b76ee460f567060ce1340f7 /buffered_file.c | |
parent | fa21d8413cf5b09b0153d8fd33bc340973ae268e (diff) | |
download | qemu-cebd32550908857e7f9129b02bb52d97e693afab.tar.gz qemu-cebd32550908857e7f9129b02bb52d97e693afab.tar.bz2 qemu-cebd32550908857e7f9129b02bb52d97e693afab.zip |
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>
Diffstat (limited to 'buffered_file.c')
-rw-r--r-- | buffered_file.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/buffered_file.c b/buffered_file.c index 1836e7e242..8435a31946 100644 --- a/buffered_file.c +++ b/buffered_file.c @@ -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; |