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 | 3d002df33eb034757d98e1ae529318f57df78f91 (patch) | |
tree | 5c2a07b26b26f74b9b76ee460f567060ce1340f7 /buffered_file.c | |
parent | b2e0a138e77245290428a7d599a929e2e1bfe510 (diff) |
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 1836e7e24..8435a3194 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; |