aboutsummaryrefslogtreecommitdiff
path: root/buffered_file.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-11-23 19:05:54 +0200
committerMichael S. Tsirkin <mst@redhat.com>2010-12-02 21:13:39 +0200
commit3d002df33eb034757d98e1ae529318f57df78f91 (patch)
tree5c2a07b26b26f74b9b76ee460f567060ce1340f7 /buffered_file.c
parentb2e0a138e77245290428a7d599a929e2e1bfe510 (diff)
downloadqemu-3d002df33eb034757d98e1ae529318f57df78f91.zip
qemu-3d002df33eb034757d98e1ae529318f57df78f91.tar.gz
qemu-3d002df33eb034757d98e1ae529318f57df78f91.tar.bz2
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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/buffered_file.c b/buffered_file.c
index 1836e7e..8435a31 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;