Skip to contentSkip to conversation

migration: Fix rate limit

PATCH In review Matthew Garrett 3 participants 3 messages Nov 25, 2013 – Dec 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: Fix rate limit

The migration thread appears to want to allow writeout to occur at full speed rather than being rate limited during completion of state saving, but sets the limit to INT_MAX when xfer_limit is INT64_MAX. This causes problems if there's more than 2GB of state left to save at this point. It probably ought to just be INT64_MAX instead.

---
 migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration.c +1 -1
index 2b1ab20..ff00bfb 100644
@@ -583,7 +583,7 @@ static void *migration_thread(void *opaque)
 
                 ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
                 if (ret >= 0) {
-                    qemu_file_set_rate_limit(s->file, INT_MAX);
+                    qemu_file_set_rate_limit(s->file, INT64_MAX);
                     qemu_savevm_state_complete(s->file);
                 }
                 qemu_mutex_unlock_iothread();
Signature · 1 line
1.8.4.2
#1 lore raw

Any feedback on this?

Quoted 29 lines · Matthew Garrett

The migration thread appears to want to allow writeout to occur at full speed rather than being rate limited during completion of state saving, but sets the limit to INT_MAX when xfer_limit is INT64_MAX. This causes problems if there's more than 2GB of state left to save at this point. It probably ought to just be INT64_MAX instead.

---
 migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration.c +1 -1
index 2b1ab20..ff00bfb 100644
@@ -583,7 +583,7 @@ static void *migration_thread(void *opaque)
 
                 ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
                 if (ret >= 0) {
-                    qemu_file_set_rate_limit(s->file, INT_MAX);
+                    qemu_file_set_rate_limit(s->file, INT64_MAX);
                     qemu_savevm_state_complete(s->file);
                 }
                 qemu_mutex_unlock_iothread();
Signature · 1 line
1.8.4.2
Signature · 1 line
Matthew Garrett | [email protected]
Reviewed-by
#2 lore raw
Quoted 18 lines · Matthew Garrett
Quoted 17 lines

The migration thread appears to want to allow writeout to occur at full speed rather than being rate limited during completion of state saving, but sets the limit to INT_MAX when xfer_limit is INT64_MAX. This causes problems if there's more than 2GB of state left to save at this point. It probably ought to just be INT64_MAX instead.

---
 migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration.c +0 -0
index 2b1ab20..ff00bfb 100644
@@ -583,7 +583,7 @@ static void *migration_thread(void *opaque)
 
Quoted 9 lines
Quoted 9 lines
migration.c +1 -2
                 ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
                 if (ret >= 0) {
-                    qemu_file_set_rate_limit(s->file, INT_MAX);
+                    qemu_file_set_rate_limit(s->file, INT64_MAX);
                     qemu_savevm_state_complete(s->file);
                 }
                 qemu_mutex_unlock_iothread();
--

1.8.4.2

I didn't see this,