]> git.proxmox.com Git - qemu.git/commitdiff
allow changing the speed of a running migration
authorGlauber Costa <glommer@redhat.com>
Wed, 20 May 2009 22:26:58 +0000 (18:26 -0400)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 22 May 2009 15:50:31 +0000 (10:50 -0500)
This patch allow us to call migrate_set_speed on running
migrations. This should allow mgmt tools to increase the allocated
bandwidth of a running migration if there is no progress, and they
really want the migration to succeed.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration.c

index cccc2d159041caef1228ad3958865e9a64f0430b..401383cf0aee45ca2e8505db5a160ea96a2053b8 100644 (file)
@@ -84,6 +84,7 @@ void do_migrate_set_speed(Monitor *mon, const char *value)
 {
     double d;
     char *ptr;
+    FdMigrationState *s;
 
     d = strtod(value, &ptr);
     switch (*ptr) {
@@ -98,6 +99,12 @@ void do_migrate_set_speed(Monitor *mon, const char *value)
     }
 
     max_throttle = (uint32_t)d;
+    s = migrate_to_fms(current_migration);
+
+    if (s) {
+        qemu_file_set_rate_limit(s->file, max_throttle);
+    }
+    
 }
 
 void do_info_migrate(Monitor *mon)