2013-05-25 18:38:28 +00:00
|
|
|
From 59df9d30f0f54158975a3d3642a1d655b177cdfe Mon Sep 17 00:00:00 2001
|
2013-05-23 01:48:57 +00:00
|
|
|
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Date: Fri, 22 Feb 2013 17:36:35 +0100
|
2013-05-25 18:38:28 +00:00
|
|
|
Subject: [PATCH] migration: use qemu_file_rate_limit consistently
|
2013-05-23 01:48:57 +00:00
|
|
|
|
|
|
|
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
|
|
|
|
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
|
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
2013-05-25 18:38:28 +00:00
|
|
|
(cherry picked from commit a0ff044b8ea81908cd8fe5819ce33780f53f58ee)
|
2013-05-23 01:48:57 +00:00
|
|
|
---
|
|
|
|
migration.c | 4 ++--
|
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/migration.c b/migration.c
|
|
|
|
index d75beca..ae2c83c 100644
|
|
|
|
--- a/migration.c
|
|
|
|
+++ b/migration.c
|
|
|
|
@@ -628,7 +628,7 @@ static void *migration_thread(void *opaque)
|
|
|
|
int64_t current_time;
|
|
|
|
uint64_t pending_size;
|
|
|
|
|
|
|
|
- if (s->bytes_xfer < s->xfer_limit) {
|
|
|
|
+ if (!qemu_file_rate_limit(s->file)) {
|
|
|
|
DPRINTF("iterate\n");
|
|
|
|
pending_size = qemu_savevm_state_pending(s->file, max_size);
|
|
|
|
DPRINTF("pending size %lu max %lu\n", pending_size, max_size);
|
|
|
|
@@ -675,7 +675,7 @@ static void *migration_thread(void *opaque)
|
|
|
|
sleep_time = 0;
|
|
|
|
initial_time = current_time;
|
|
|
|
}
|
|
|
|
- if (s->bytes_xfer >= s->xfer_limit) {
|
|
|
|
+ if (qemu_file_rate_limit(s->file)) {
|
|
|
|
/* usleep expects microseconds */
|
|
|
|
g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
|
|
|
|
sleep_time += qemu_get_clock_ms(rt_clock) - current_time;
|